cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports prompt issue on export: “The report you requested requires further information”

kinyanjui_kamau
Participant
0 Kudos
232

I have searched through forums for a solution but none seem to work for me.

I have an ASP Webform/MySql application which displays Crystal Reports.

The ones which do not require a user to enter a parameter display fine and I am able to click on export on the CR toolbar and download, e.g. .pdf format.

On the report that require a user to enter a parameter, the report renders fine but when I click on the export button, i get the prompt:

"The report you requested requires further information"


asking for DB login credentials. How can I avoid this?


My Code:


Aspx page:

......

<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Web" TagPrefix="CR" %>

.....

<div>

          <CR:CrystalReportViewer Width="960px" ID="CrystalReportViewer1" runat="server" AutoDataBind="true" />

</div>

protected void Page_Load(object sender, EventArgs e)
{
        
if (Request.QueryString["report"] != null)
        
{
               
string reportToGet = Convert.ToString(Request.QueryString["report"]);

               
switch (reportToGet)
               
{
                       
case "payslip":
                       
PaySlip();
                       
break;
                       
case "pastpayslip":
                       
PanelPastPaySlip.Visible = true;
                       
break;  
                      
default:
                      
break;
               
}
         
}
  
}


protected void btnSearch_Click(object sender, EventArgs e)
{
     
if (txtDate.Text != null || txtDate.Text != string.Empty)
     
if (DateTime.TryParseExact(txtDate.Text, "yyyy-MM-dd", CultureInfo.InvariantCulture,
     
DateTimeStyles.None, out date))
     
PastPaySlip();
}


private void PastPaySlip()

        {

            // Some code....

            PayMasterDataSetTableAdapters.pastpayslipcasualviewTableAdapter ta =

                new PayMasterDataSetTableAdapters.pastpayslipcasualviewTableAdapter();

            PayMasterDataSet.pastpayslipcasualviewDataTable dt = new PayMasterDataSet.pastpayslipcasualviewDataTable();

            ta.FillBy(dt, userId, businessId);

            cReport = new ReportDocument();

            string reportPath = Server.MapPath("~/Views/CasualLabour/Reports/PastPaySlip.rpt");

            cReport.Load(reportPath);

            cReport.SetDataSource((DataTable)dt);

            cReport.SetParameterValue("Date", date);

            cReport.SetDatabaseLogon("userID", "password", "server", "database");

            CrystalReportViewer1.ReportSource = cReport;

            CrystalReportViewer1.ReuseParameterValuesOnRefresh = true;

        }

I am using CR V. 13.0.9 and VS 2013 Update 2

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

This is because almost any action on the viewer result sin a postback. This includes paging, zooming, drilling exporting and printing. E.g.; you will have to place the report in session. See the following KB for how to:

1985571 - How to use sessions in web applications using the Crystal Reports viewer (the complete co...

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

kinyanjui_kamau
Participant
0 Kudos

Thanks a lot Mr. Uher. This had been troubling me since yesterday and needed a solution fast. You saved the day!

former_member183750
Active Contributor
0 Kudos

Excellent

happy coding,

- Ludek

Former Member
0 Kudos

I used your code but it prompt Object Reference not set to an instance when i change paging??

Answers (0)