Skip to Content

Crystal report works on localhost, but it doesn´t work after publish in IIS

Hi SAP workers, is a pleasure to join at this community.

This is my first question and I want to explain the situation.

I use Crystal reports (version CRforVS_13_0_21) in Visual Studio 2017 in 64 bits.

Then, I have a report that functions very well in my PC, but when I try to export to PDF in the publish web site (in IIS) throws me the next error:

No se pudo abrir la conexión.
temp_49a4fd90-5fe3-475d-96e0-4adadcc07890 1196_1208_{0CF02AEA-0B01-446A-BF6A-34EAC10FB35B}.rpt

I don´t understand why is show me that line.

My connection is ODBC (RDO) type (I use a dataset to load the report).

The code for load the report is:

//First use this instruction to load the report and save in a session variable.

PDFOC rpt1 = new PDFOC();

if (txtNOC.Text.Length > 0)

{

string repaxu = txtNOC.Text;

repaxu = repaxu.Replace("OC", "");

rpt1.SetParameterValue("id Compra", Int32.Parse(repaxu));

}

else

{

rpt1.SetParameterValue("id Compra", Int32.Parse("0"));

}

crvoc.ReportSource = rpt1;

Session["reporte"] = rpt1;

//Next, after button click, I load the session and export to pdf


PDFOC rpt1 = (PDFOC)Session["reporte"];

rpt1.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, "Orden de Compra");

Please help me, I don´t understand where is the error.

Thank you so much, have a nice weekend.

error-cr-vs.png (88.0 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • 5 days ago

    Remove the code to set parameter value, it should prompt for log on info and the parameter prompt should pop up.

    Add comment
    10|10000 characters needed characters exceeded

    • I remove the parameter value and the parameter prompt don´t pop up.

      Could be that I need permission to conect at the DataBase? The report in my PC works good, only after publish in IIS I have problems.

      Thank you so much!

  • Feb 11 at 05:19 PM

    Looks like you are setting the parameter before opening the report.

    Try opening the report and then setting the parameter values.

    Add comment
    10|10000 characters needed characters exceeded

  • 5 days ago

    If you just preview the report and use the Viewers Export feature does that work?

    Use Fiddler to see what it says, likely need to add a share on the viewer folder with full read/write and add permissions to the \Temp folder as well.

    Is IIS running in 32 or 64 bit mode?

    Did you install the same MSI package?

    Add comment
    10|10000 characters needed characters exceeded

    • I finally get the error. When I do the report and I pass the parameter in the file, the export only functions with the same value typed in the visual studio (in the localhost and the publish works), but when I put a diferent value at the parameter in the .rpt, then the connection fails and the error appears.

      The conecction to DataBase is for a remot server (i dont have installed the mysql, because I connect to a server) but the connector is already installed.

      I think the IIS run in 64 bits. After searching, I can find why the report have that behavior.

  • 4 days ago

    So it works with saved data but you can't connect when refreshing so it's likely a DB client problem.

    Your app depends on the runtime and client it needs, so if IIS is running in 64 bit mode you need to 64 bit Client installed.

    Add comment
    10|10000 characters needed characters exceeded