Quantcast
Channel: SCN : Discussion List - SAP Crystal Reports, version for Visual Studio
Viewing all 3636 articles
Browse latest View live

ADO.NET: Exception...target of an invocation, when using WebConfigurationManager outside of Try Catch

$
0
0

I’m in the process of creating several Crystal Reports that will use an ADO.NET datasources that were generated using datasets generated from a classes shared functions .  When creating my second report, Crystal Designer reported an error after choosing the method from my new class.  The error was:

“Login Failed.  Details: mscorlib: Exception has been thrown by the target of an invocation.”

I didn’t have this issue at all with my first report.  To validate the dataset, I created a test web page which I linked the same dataset to a data grid and it worked just fine.

It took me a while, comparing the code between my classes and changing the new class one line at a time to match the working class, but I figured out the cause.  In my new class, I was using multiple databases for the source of creating the dataset being returned in my new class.  As part of that, I was making a call to get the connection string to the database from my web.config.  Basically this line was causing the error:

Dim ConnStr as String = WebConfigurationManager.ConnectionStrings.Item("oConnectionString").ToString()

I found if I wrapped it in a Try Catch, the error went away when trying to link to it in CR Designer.  I had all my other .NET calls wrapped in a Try Catch in my first class and that is why I didn’t get this error before.  This one was not easy to figure out the conditions as to how “make things work”.  The error message was little to generic to even suggest what was wrong too.

I am still puzzled as to why a Try Catch fixed the issue with CR Designer though.  Also I would like to know if the code really was my in error or is this a bug in CR Designer.

I've attached sample code images of the error.


SAP Crystal Reports for VS2010 ReportDocument.Load() Freezes in Windows 2008 R2 x64

$
0
0

Dear All,

 

I have a problem in a Windows Server 2008 R2 Enterprise 64 Bits SP1 with a report.rpt. It freezes when is called the Load(pathName) method of ReportDocument. Others reports.rpt use the same method, they are in the same folder, and works well. This specific report works well in an another operational system too.

 

I'm using a Microsoft Framework .NET 4.0 64 Bits application in a Internet Information Services 7.5.

 

The version of Crystal installed in the server is CRforVS_redist_install_64bit_13_0_6. I already had uninstalled and installed for three times... thinking that there was any problem in the installation in the server.

 

The Report.rpt contains subreports. The subreports are shown against the data sent through dataset and parameters. In others machine with Windows 7 Professional 64 Bits with the same configuration and crystal installed, all subreports run fine with the same dataset and parameters.

 

I've checked the registry keys and try to configure anything without success. The registry keys there are:

Windows Registry Editor Version 5.00

 

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\InprocServer]

"DataEngineName"="C:\\Program Files (x86)\\SAP BusinessObjects\\Crystal Reports for .NET Framework 4.0\\Common\\SAP BusinessObjects Enterprise XI 4.0\\win64_x64\\crpe32.dll"

"ProcessingExtensionPath"="C:\\Program Files (x86)\\SAP BusinessObjects\\Crystal Reports for .NET Framework 4.0\\Common\\SAP BusinessObjects Enterprise XI 4.0\\win64_x64\\ProcessExt"

"AgentLimit"="3000"

"AgentTimeoutMins"="60"

"ConnectionDirMgrProgIDs"="CrystalReports13.LocalConnMgr.0"

"DisablePrintJobCloning"="Yes"

"EnterpriseRequestTimeout(min)"="600000"

"JobSharingMaxDataAge(sec)"="12000"

"PrintJobLimit"="-1"

"PrintJobSharingTimeout"="90"

"ProcessAffinityMask"="-1"

"ReportDirMgrProgID"="CrystalReports13.LocalReportMgr.0"

"RequestWorkerThread"="500"

"ResultFieldsSortMethod"="1"

 

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\InprocServer\LocalConnectionMgr]

"ConnectionDirectoryPath"="c:\\"

 

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\InprocServer\ReportDocument]

"AsnycSQL"="No"

"MaxNumOfRecords"="-1"

"NumOfBrowsingRecords"="1000"

"NumOfCachedBatches"="-1"

"PushDownGroupBy"="No"

"ReportStyle"="9"

"RowsetBatchSize"="1000"

"SaveDataWithDoc"="Yes"

"SelectDistinctRecords"="No"

 

[HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Report Application Server\InprocServer\RptDirMgrProgIDs]

"default"="CrystalReports13.LocalReportMgr.0"

"file"="CrystalReports13.LocalReportMgr.0"

"ras"="CrystalReports13.LocalReportMgr.0"

 

Best regards,

Jener Garcia Menezes

System Architect at Prosegur S/A

Why the 'FileNotFound' Exception for crdb_adoplus.dll, is my installation faulty?

$
0
0

I´m upgrading a VB6 program yo Visual Studio 2012, using Crystal Reports for Visual Studio to upgrade the reports. The report's rpt files upgrade without any problem, but when I try to show a report using a stored procedure with parameters I get a  'FileNotFound' Exception for crdb_adoplus.dll, This is a Crystal Reports installation file which isn´t where its supposed to be. There is a crdb_adoplus.dll file one folder up, but if I put it in the right place, I get a FileLoad Exception which points to version problems, saying the assembly hay been compiled with version 'v2.0.50727, not the one supplied.

 

It seems my installation faulty. If so, how do I get it right? I'm using CRforVS_13_0_6, and I've already re installed it.

 

I'm attaching the C# file with code I'm using (code.cs) and the errors (errors.txt).

"Crystal Reports - " prefixed to report file name

$
0
0

When I send my report to a file printer like PDF Creator or Microsoft XPS Document Writer, I get the string "Crystal Reports - " (without the quotes) automatically prefixed to the report name I set in the property myReport.SummaryInfo.ReportTitle, i. e. Crystal Reports - myReportName.

Does anyone know a way to prevent this behaviour?

Thanks in advance.

Help missing in Visual Studio

$
0
0

Previously I used SAP Crystal Reports 13.0.5. for Visual Studio (in VS2012), and when I hit F1 in Visual Studio all the help/developer information was there. Now I have updated to 13.0.6, and the Crystal Reports help info is no longer there in the Visual Studio help viewer?

SAP Crystal reports 2013

$
0
0

hi all,

i need access to SAP crystal reports 2013.

Can any one advise ?

Print dialog window is not closing after the report is printed on IE10

$
0
0

Hi There,

 

we have a legacy asp.net web application that we need to make compatible with IE10.

Our problem is that when a report is printed the 'Print' dialog/status box that is popped up by the CrystalReportViewer is not closing automatically after the report successfully printed. It stays open and must be closed manually.

Not a big deal, but might be annoying for the users to close it every time .

 

If we turn on the 'Compatibility View" all works like a charm, and the 'Print" status box is closed properly after the report is successfully printed.

 

This is a legacy application that uses framesets/frames this might play role too.

 

Does anyone experienced this behavior that this dialog box is not closing automatically?

 

Any input is appreciated.

Crystal Reports not showing report on ActionResult MVC3

$
0
0

After tryingseveral optionsI fail todeploya report andI am not gettinganyspecific error.


I am developingin VisualStudio 2010withMVC3Razor.


I havea viewto invoice

This is part of the view:

@model Models.FacturaHeaderModel
@{    ViewBag.Title = "Facturación de Compras";    Layout = "~/Views/Shared/_Layout.cshtml";    }
@using (Html.BeginForm("Guardar", "Facturas", FormMethod.Post, new { id = "factura" }))
{    <fieldset>        <div class="editor-label" style="font-size:16px;">            @Html.LabelFor(m => m.Movimiento.DescripLarga)            <div class="editor-field">                @Html.TextBoxFor(m => m.Movimiento.DescripLarga, new { @readonly = "readonly", style = "font-weight: bold;font-size:16px;" })            </div>        </div>
....    </fieldset>        <input type="submit" name="Guardar" id="guardar" title="Guardar" value="Guardar" />
}

 

This is part of ActionResult

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Guardar(FacturaHeaderModel model, FormCollection formCollection)
{            if (ModelState.IsValid)            {
..... save data.......                var reporte = System.Web.HttpContext.Current.Request.PhysicalApplicationPath + @"rpt\Factura.rpt";                var rptH = new ReportClass { FileName = reporte };                rptH.Load();                var cnn = new ReportHelper();                cnn.Connect(ref rptH); //connect database                rptH.RecordSelectionFormula = "{CtaCteCliente.CtaCteClienteId}=" + facturaId;                var stream = rptH.ExportToStream(ExportFormatType.PortableDocFormat);                return File(stream, "application/pdf");            }
}

 

For some reasonthough thereport is designedproperly andfrom the designerworking properlyand after makingseveral attempts todebug thecode to detectthat is wrongdoes not seem tobeanything unusual.

Some queries:
This error maybe caused bythe type of responseexpected byvisual studio?

Is there anyway to getcrystal reportserrorin previousversionsassomething like:

rptH.LastError

SAP Crystal Add-in error message

$
0
0

Hi all

 

I have installed SAP B1 version 9 PL05 and have also installed SAP Crystal Reports Version 14.0.4.738

 

I can edit a document (for example a PO) from within SAP but if I make a change and choose;

 

Add-Ins - Sap Business One - Preview in SAP B1 or

Add-Ins - Sap Business One - Save

 

I get the following message;

 

 

I have uninstalled crystal, the sap client etc.....cant find this exact message in the portal or on google.

 

Does anyone have a solution to my problem?

 

Thanks

 

Conor

Crystal Report Generation Timeout

$
0
0

Hello All,

 

I am hoping to find a way to set a timeout on the generation (not connection) of a Crystal Report in CRXI R2.

 

Ideally, once I call the method, ReportDocument.ExportToDisk(), I would like an exception to occur if the generation takes longer than say, 1 minute.

NOTE: Our Crystal Reports use stored procedures to gather data from an SQL Server 2008 R2 Database.

 

I have attempted the following, without success:

1) Altering the Connection String used to build ConnectionInfo: there is no timeout property.

 

2) Adding an attribute to the ConnectionInfo.Attributes.

     connInfo.Attributes.Collection.Add(New NameValuePair2("General Timeout", "1"))

     => This just caused my report generation to fail.

 

3) Setting the "General Timeout" property of the ReportDocumentDataSourceConnections(index).LogonProperties.   This is done for the Main Report and for subreports.  (Maybe I have done this incorrectly. The "General Timeout" property is being modified, as viewed in the debugger.)

     For index As Integer = 0 To reportDoc.DataSourceConnections.Count - 1

          reportDoc.DataSourceConnections(index).LogonProperties.Set("General Timeout", "1")

     Next

     Note: I am unsure of the time units for the "General Timeout" - the above assumes "minutes".

               => Report Generation did not fail after either 1 or 60 seconds.

 

 

Might anyone know a way to do this correctly?

Kind thank yous!

 

 

TOOLS

================

Crystal Reports XI R2

VB.NET 2.0

SQL Server 2008 R2

Crystal Reports for Visual Studio Hangs

$
0
0

I have an ASP.NET app that runs without fail in development.  Recently the reports in production have begun to fail.  When they fail they just hang, no error, nothing in event logs.  I can only fix by resaving the report (note I don't need to make any changes).  It then works for a few more attempts and then fails again.

 

Product is WIndows 2008 64bit.  App built with VS 2010, ASP.NET C#.

 

Have installed both 64 bit runtimes and the complete VS Developer support.  Both at latest service pack (6).  No difference.

 

Tried making the report files read only.  No difference.

 

Am banging my head against a wall with this, as is my client.

 

Anyone got any ideas?

Floating point rounding error in CR2011

$
0
0

Hi All,

 

I just upgraded our CrystalReports from 2008 to 2011, but I found there are some floating point rounding errors happened in the reports generated by the CR2011 (using "SAP Crystal Reports, developer version for Microsoft Visual Studio" libraries). The following is the example:

 

 

There is a field in my report (in fact, is a sub-report) to display (with 2 decimal points) the result output of my "sp_xxx;1.mLiab", and the following are its output values:

 

2008596.2770

1104305.8400

342524.3890

167207.5140

87253.0120

15414.4130

0.0000

 

And, there is another field in my report to display (with 2 decimal points) the sum up value of the output of my "sp_xxx;1.mLiab". The displayed value should be 3725301.45 in theory (as it is truncated from the actual summation output -> 3725301.445), but I found the CR2011 output me the wrong result 3725301.44. I have also tried to generated the same report by using CrystalReports 2008 and CrystalReports XI, and they also output me a correct value.


Does any one know what is the problem? Is it a bug? or, anything I configured in wrong way? Thanks in advance.


Cheers,

Elliott

Crystal Reports 8 export troubles in Windows7

$
0
0

I have
an older application which uses Cryst 8 and we use the activeX viewer. We turned
on the export button in the viewer. The export feature works on some machines
but on others it works up to the point of displaying the window that allows the
user to choose where to save the file. This window does not open at least on
some machines. What am I missing? I am desperate any help would be appreciated.
It works on XP but not in Win7.



Software:

Visual Studio 2003/C++ unmanaged

Highlight row in viewer

$
0
0

Hi Crystal Reports Expert !

 

In older versions of CR, we were able to highlight a row at runtime so that the line the user wanted to analyse (or see more clearly) was framed by a blue box. Now we can highlight a single field... Is there a way to highlight the entire row again ?

 

PS. I don't want to alternate row highlight a design, it cost to must at printout...

 

Old crystal version

Capture2.JPG

Crystal XI (or so!)

 

Capture3.JPG

Thank for your help !

SAP Crystal Reports, developer version for Microsoft Visual Studio Printing Issue

$
0
0

I have an issue where the font size is smaller than normal and the margins are also reduced from the original settings. I am using an application which requests a report this request is then presented in a new window which appears to be fine. The font seems to be correct and the margins seem to be the same size as I expect. When I print this report the margins are about 3/8" smaller on each side and the font is much smaller than normal. The font is so small that you really have to get close to read it normal.

 

I have searched the forums to find the right solution and the registry settings and various workarounds do not seem work or don't apply. I am sure that there is something specific that does work, but I haven't seen it yet. I also searched the release notes http://scn.sap.com/docs/DOC-7824 for something that is addressed for this issue, but no luck there either.

 

Another thing to note is that one of the suggestions for the margin issue is to change the default printer setting from Fit to Actual Size. This does attempt to set the margins back to the normal setting, but what it actually does is stretch the page as if it was an image. The report isn't rendered with the changes it is simply stretched out. I only saw this today when a specific font type was on a report in Bold. Once the actual size was set and the page came out of the printer the font was blurred and almost unreadable whereas Fit printed it just smaller than it should be.

 

Thoughts?


CR2011 is there a runtime 14 available

$
0
0

I understand that I can use the following:

 

CR2011 Reports using the Runtime 13.X

Reports Developer Machine Requirements

The above requires the developer to develop the report in CR2011 and save the file. Open the file in VS2010 and save the project than save the .RPT file. This provides the report with the needed elements for the runtime 13. The .RPT can be moved to the server at this point to used for production.

 

Application Developer's Machine

 

Web Server

  • MSI 64 Bit http://scn.sap.com/docs/DOC-7824
  • The Application package from the Application Developer's machine
  • The .RPT file after it has been created and saved as mentioned above

 

What I am trying to find out is if there is a another runtime (e.g Runtime 14) that supports CR2011 without having to have the VS2010 and the install executable on the reports developer machine. I believe this is how is was setup for CR2008 when using the Runtime 12. The only reason VS2010 and the install executable is needed is the runtime 13 doesn't support CR2011 directly, which was determine a few years ago.

 

If someone could fill in the XXs and ??s below that would be great. I would also like a link to the page that contains the runtime downloads so I can get the downlaods and review the developer guides and API information related to that runtime.

 

CR2011 Reports using the Runtime XX.X

Reports Developer Machine Requirements

  • CR2011

    

Application Developer's Machine

  • Visual Studio Version ???
  • Install Executable for runtime XX.X    

 

Web Server

  • Runtime version ???

 

I am asking about this as some customers would like to develop their own reports on a local installation of our product, so if CR2011 can reference a runtime without having VSXXXX and the install executable XX.X being installed on their machine the overall costs and training would be greatly reduced.

 

Seeking answers...

 

Roy

facing error in deployment desktop application vs 2010 with CR integrated

$
0
0

Report is directly CREATED WITH database SQLOLEDB PROVIDER

CODE IN vb FORM ARE AS FOLLOWS

Public Sub giveLogin()

        connfo.ServerName = conclass.oldserver

        connfo.DatabaseName = conclass.olddata

        connfo.UserID = conclass.olduid

        connfo.Password = conclass.oldpass

        For Each cnInfo As TableLogOnInfo In Me.CrystalReportViewer1.LogOnInfo

            If cnInfo.ConnectionInfo.ServerName.ToString.ToUpper <> connfo.ServerName.ToString.ToUpper Then

                For Each connection In salchart111.DataSourceConnections

                    salchart111.DataSourceConnections(conclass.oldserver, conclass.olddata).SetConnection(conclass.newserver, conclass.newdata, conclass.newuid, conclass.newpass)

                Next

                connfo.ServerName = conclass.newserver

                connfo.DatabaseName = conclass.newdata

                connfo.UserID = conclass.newuid

                connfo.Password = conclass.newpass

                For Each tblLogon As TableLogOnInfo In CrystalReportViewer1.LogOnInfo

                    tblLogon.ConnectionInfo = connfo

                Next

            Else

                For Each tblLogon As TableLogOnInfo In CrystalReportViewer1.LogOnInfo

                    tblLogon.ConnectionInfo = connfo

                Next

            End If

        Next

    End Sub

 

    Private Sub BranchSalary_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.MdiParent = Mainwindow

        giveLogin()

        Me.CrystalReportViewer1.ParameterFieldInfo.Clear()

        Dim ParamFields As ParameterFields = Me.CrystalReportViewer1.ParameterFieldInfo

        Dim cmonth, cyear As New ParameterField

        cmonth.Name = "cmonth"

        cyear.Name = "cyear"

        Dim cyear_v, cmonth_v As New ParameterDiscreteValue

        cyear_v.Value = cyer

        cmonth_v.Value = cmon

        cmonth.CurrentValues.Add(cmonth_v)

        cyear.CurrentValues.Add(cyear_v)

        ParamFields.Add(cmonth)

        ParamFields.Add(cyear)

        '   Me.CrystalReportViewer1.ReportSource = My.Application.Info.DirectoryPath & "/salchart11.rpt"

        CrystalReportViewer1.RefreshReport()

        giveLogin()

    End Sub

PROMPTING ERROR ON CLIENT MACHINE :  BUT RUNNING WELL IN DEVELOPMENT MACHINE

 

Failed to open the connection. Details: [Database Vendor Code:17]

Crystal reports displaying a blank page.

$
0
0

Hello,

 

I have a VS2010 MVC project. Created Crystal Reports and programatically used the code as below..

This works fine when running on my local machine..

 

ReportClass rptH = new ReportClass();
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos();
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();
Tables CrTables;


fileName = Path.Combine(crystalReportPath, "Test.rpt");
rptH.FileName = fileName;
rptH.Load();
rptH.Refresh();




crConnectionInfo = ReportServ.GetCrystalReportConnection();




CrTables = rptH.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in CrTables)
{
    crtableLogoninfo = crTable.LogOnInfo;    crtableLogoninfo.ConnectionInfo = crConnectionInfo;    crTable.ApplyLogOnInfo(crtableLogoninfo);
}


rptH.SetParameterValue("@p_year", pYear);


Stream stream = rptH.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

return File(stream, "application/pdf");

 

Set the Test.rpt file Build Action to "Content", created a SetUp project and deployed the MSI package onto the server.

The server is a Win2003 server, where "CRRuntime_32bit_13_0_6.msi" package has been installed.

All the stored procedures and database tables are set up correctly.

 

On the click of the button the above code runs and displays a blank page..

 

Have been scouring through the forums but not able to find a solution.

 

Any help is very much appreciated..

 

Thanks

 

Please

Report not showing in reportviewer, just vertical grey bars.

$
0
0

I created two reports, one in Microsoft reporting services and the other with crystal reports.  I use the same dataset to pass to both.  The Microsoft report displays fine, the crystal report viewer however just displays a pattern of vertical grey bars (see at bottom).

 

My code is below:

 

         

OdbcConnection conObj = newOdbcConnection("");


conObj.ConnectionString =  @"Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=C:\webDev\test.accdb;";


conObj.Open();


String sqlStmt = "my select statement here: removed on purpose";

           

OdbcCommand cmd = newOdbcCommand(sqlStmt,conObj);


OdbcDataAdapter da = newOdbcDataAdapter(cmd);


testData ds = newtestData();


da.Fill(ds, "CMR_testData");



// record count is showing 2 records

int rc = ds.Tables["CMR_testData"].Rows.Count;


           

CrystalReport1 oRpt = newCrystalReport1();

 

oRpt.Database.Tables[0].SetDataSource(ds);



CrystalReportViewer1.ReportSource = oRpt;


CrystalReportViewer1.RefreshReport();

 

conObj.Close();

 

 

Here is what I see:


crystal_report.PNG

 

Hopefully someone can shed some light on what I am doing wrong.

 

Thanks,

Garth

Relationships between tables can not be detected

$
0
0

Hello

 

I developed an application in VB.Net 2010 with a MySQL database. I tried to define a CrystalReport report for this application, but at the creation of this report, the relationship between the tables can not be detected.

 

Also, I have another problem when running a CrystalReport; the application demandes the connection ID and password?

 

Best Regards

Viewing all 3636 articles
Browse latest View live


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