Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

SAP crystal report ASP.net Shows data in crystal report viewer but exports blank

$
0
0

I am having a crystal report which is getting its data from a stored procedure with parameter. Whenever I am verifying the database its asking me to provide the values to parameters. I didnt gave any values since i want to pass it through c# program. I did the program and while running in crystal report viewer I am getting the result also.

But while i click export/print I am getting only my header and blank detail section. If I give some test values while verifying the database or while refreshing the report preview while designing, I am getting export result as per those default values.

How can I get the actual value which is displayed in CR viewer on export/print

This is the code on button click event

        rptDoc = new ReportDocument();
        string rptPath = Server.MapPath("rptnamr.rpt");
        rptDoc.Load(rptPath); 
        rptDoc.SetParameterValue("@para1", exid); 
        rptDoc.SetParameterValue("@para1", drpCourseLst.SelectedValue.ToString());
        CrystalReportViewer1.ReportSource = rptDoc;
        rptDoc.SetDatabaseLogon("usrnm", "mypassword", "my server name", "db name");

 

the crystal report viewer code is

<CR:CrystalReportViewer ID="CrystalReportViewer1" ToolPanelView="None" style="position:relative;  margin-top: 10%;; z-index:0"  DisplayToolbar="True" HasDrilldownTabs="False" Height="140px" EnableParameterPrompt="false" EnableDatabaseLogonPrompt="false"  HasToggleGroupTreeButton="false" runat="server" ReuseParameterValuesOnRefresh="true"/>

 


Viewing all articles
Browse latest Browse all 1507

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>