Hello ,
I Created Page with Button and Crystal Report. While I Click the Button in page crystal report preview will appear.
crystal report preview working fine till if i click any tools in crystal report toolbar. if i click any tools in crystal report page reloaded and report becomes blank.
Its My Code Behind
protected void Page_Load(object sender, EventArgs e)
{
}
private void LoadReport_Ass()
{
DataSet dd1 = T.GetDetailsFromDatabaseVia_Block("SELECT * FROM RoomDetails", new int[] { 2 });
DataSet dd2 = T.GetDetailsFromDatabaseVia_Block("SELECT * FROM BlockDetails", new int[] { 1, 2 });
DataSet dd3 = T.GetDetailsFromDatabaseVia_Block("SELECT * FROM FloorDetails", new int[] { 2, 3 });
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load(Server.MapPath("Report_RoomDetails.rpt"));
CrystalReportViewer1.EnableDatabaseLogonPrompt = false;
cryRpt.SetDatabaseLogon("sa", "123");
cryRpt.Database.Tables[0].SetDataSource(dd1.Tables[0]);
cryRpt.Database.Tables[1].SetDataSource(dd2.Tables[0]);
cryRpt.Database.Tables[2].SetDataSource(dd3.Tables[0]);
CrystalReportViewer1.ReportSource = cryRpt;
}
protected void Button1_Click(object sender, EventArgs e)
{
LoadReport_Ass();
}
In Source
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel runat="server" id="UpdatePanel" updatemode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger controlid="Button1" eventname="Click" />
</Triggers>
<ContentTemplate>
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" GroupTreeStyle-BackColor="#999966"/>
</ContentTemplate>
</asp:UpdatePanel>
can u plz any one tell solution for this....