Question

I am trying to export a crystal report document to PDF and i am getting this error message. I can connect to database and query out the data, put it to a Dataset and bind the Dataset to Report object. but when i Export to HttpResponse i got below error. Any one experience this prblem before? Please help. Thanks.

Logon failed.
Details: ADO Error Code: 0x
Source: Microsoft OLE DB Provider for SQL Server
Description: Login failed for user '727_User'.
SQL State: 42000
Native Error: Error in File C:\Windows\TEMP\ABCDReport {9242A97D-A37F-4B18-A22E-8F0F22416D73}.rpt:
Unable to connect: incorrect log on parameters.

This is my C# Code behind.

rep.SetDataSource(ds.Tables[0]);  
rep.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, "ABCDReport");
Was it helpful?

Solution

i have found the problem. I forgot to bind the second datatable to Subreport and that's causing the problem. Below is my final Code. Thanks.

rep.SetDataSource(ds.Tables[0]);
        if (ds.Tables.Count > 1)
        {
            if (ds.Tables[1].Rows.Count > 0)
            {
                rep.OpenSubreport("Subrep1").SetDataSource(ds.Tables[1]);
            }

        }



rep.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, "ABCDReport");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top