Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

In a C# windows form project, I used "CrystalReportViewer" control to view ".rpt" files. It works correctly and loads rpt files corredctly. But...

Unfortunately, In other systems, it's exe file occurred with this error:

Ether the crystal Reports registry key permissions are insufficient ... 


Therefore the rpt files can't be shown!

what is the problem in other systems????

My project is created in Visual studio 2015. And in other systems, I run and installed the x86 and x64 CRRuntime (version 18, and older) the versions 10 and 11 of crystal report are installed in all systems, and they registered correctly.

I tested this: compiling exe By setting the "Target Framework" on ".NET Freameword 4" and "4.5" . Unfortunately, it has same error...

In all my tests, the rpt files there are in the current path of exe.

Please Help Me! thank you

//***** this is my testing code:
private void crystalReportViewer1_Load(object sender, EventArgs e)
    {
            ReportDocument cryRpt = new ReportDocument();
            cryRpt.Load(strRptPath);
            cryRpt.DataSourceConnections[0].SetConnection("MyServer", "DBName", false);
            cryRpt.DataSourceConnections[0].IntegratedSecurity = true;

            cryRpt.SetParameterValue("CenterName", strCenterName);
            cryRpt.RecordSelectionFormula = "{Table.Field} = 'value'";

            crystalReportViewer1.ReportSource = cryRpt;
            crystalReportViewer1.Refresh();
        }

    }


What I have tried:

to view .rpt file in a windows form C# project
Posted
Updated 6-May-17 18:23pm
Comments
jame01 19-Feb-17 15:04pm    
what do you mean by other systems?
are you creating installing file?
did you attached your .rpt file your installation file ?
Zon-cpp 21-Feb-17 1:01am    
"other system" means systems that is not my system.
the .rpt file is in current path of exe file. the error isn't a "not find file" error. the error is about using crystal report...
jame01 25-Feb-17 15:52pm    
did you make crystal report properties content?
and you should write path of your crystal report in the config file.
if you couldn't found let me know i think I can help

1 solution

the version of below dlls (that I had added those in reference ) using in project, was 10.
I change this file to version 13 then it's compiled run correctly in other system

I don't know why the version 10 was not correct
thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900