Quantcast
Channel: SCN : Unanswered Discussions - SAP Crystal Reports, version for Visual Studio
Viewing all 2556 articles
Browse latest View live

Getting error,while complie the .net code

$
0
0

System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. --->   at CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor()   --- End of inner exception stack trace ---   at CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor()   at My.UsersReport.Page_Load(Object sender, EventArgs e)


Failed to open the connection error

$
0
0

Hi,

 

I have a crystal report in my .net App. I want to fetch data from another server on report running on my machine. Hence, I pass connection dynamically in the code. The remote server will not have DSN configured. I should be able to pass all the details in code only. I do not want any ODBC dependency.

Following is the code snippet I use to pass these details:

 

           ReportDocument rpt = new ReportDocument();

            rpt.Load( pathToreport);

 

            ConnectionInfo crConnectionInfo = new ConnectionInfo();

            crConnectionInfo.ServerName = serverName;

            crConnectionInfo.DatabaseName = DatabaseName;

            crConnectionInfo.UserID = userName;

            crConnectionInfo.Password = passwd;

 

            CrystalDecisions.CrystalReports.Engine.Tables CrTables = rpt.Database.Tables;

            TableLogOnInfo crtableLogoninfo = new TableLogOnInfo();

            foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)

            {

                crtableLogoninfo = CrTable.LogOnInfo;

                crtableLogoninfo.ConnectionInfo = crConnectionInfo;

                CrTable.ApplyLogOnInfo(crtableLogoninfo);

            }

 

             crystalReportViewer1.ReportSource = rpt;

            crystalReportViewer1.RefreshReport();

 

But,running this code gives me error saying,

 

 

Is there any specific format in which i shall pass the server name for this type of connection?

Or I am missing anything else?

 

Please help.

Does anyone know how to discard printer information from a report?

$
0
0

Hello all,

 

We've got several reports in which printer info is saved in the report.

We would like to remove that info programmatically from the report.

Does anyone how to do that and to save this modified info to the report?

I would be pleased to be given a code example.

 

I guess it should be something like the fragment below, but saving this to the report doesn't seem to be doable.

 

printOptions.SavedDriverName = printOptions.DriverName = "DISPLAY";

printOptions.SavedPortName = printOptions.PortName = string.Empty;

printOptions.SavedPrinterName = printOptions.PrinterName = string.Empty;

printOptions.PaperSize = CrPaperSizeEnum.crPaperSizeDefault;

printOptions.PaperOrientation = CrPaperOrientationEnum.crPaperOrientationDefault;

printOptions.PaperSource = CrPaperSourceEnum.crPaperSourceAuto;

report.ReportClientDocument.PrintOutputController.ModifyPrintOptions(printOptions);

report.ReportClientDocument.PrintOutputController.ModifyPrinterName(string.Empty);

report.ReportClientDocument.PrintOutputController.ModifyPageMargins(0, 0, 0, 0);

report.ReportClientDocument.PrintOutputController.ModifyPaperOrientation(CrPaperOrientationEnum.crPaperOrientationDefault);

 

Thanks,

Henk Spaan.

Printlayout shrinks after moving from Version 10 to 13

$
0
0

Hello,

 

I'm new to this community, although I learned a lot of it because I found most of my questions asked and answered  before.

Thank you for that.

 

We use Crystal Reports in our .Net Application for over 10 years now in many different ways with no major issues, but since we moved from Version 10 to 13, because Windows 8.1 doesn't like CR 10, we had quite some.

 

In some cases we use the PrintReport() method from the viewer directly especially when we print Labels.

In Version 13 the viewer seems to squeeze the print and the positioning, even of the first label is wrong.

 

I tried to print via the PrintToPrinter() method from the document with all combinations of parameters that made sense to me, but with no success.

 

We really have no idea how to change this behaviour, adjusting the Reports to fit the new viewer is no option for us, as there are several hundreds of them.

 

Any ideas on that are welcome.

 

Thanks,

Mike

Number of simultaneous reports in web application

$
0
0

Is there a limitation regarding the number of simultaneous reports that can be processed (exported to PDF) for a web application developed with SAP Crystal Reports for Visual Studio?  Could there be license problems?

Our application is currently using Crystal Reports XI but our client is planning to upgrade the server to Windows Server 2012, and it seems that the only version of Crystal Reports that would work with this operating system is SAP CR for Visual Studio.  We have the doubt about the number of simultaneous reports.

limit to COMMAND ?

$
0
0

there seems to be a limit on COMMAND

is there a way to expand this? i have group of sql'a 1000 or so lines. if not room for all the code, what do i do?

wpf crystal repors events

$
0
0

I am planning to migrate from Active reports to crystal reports.

 

In active reports many events are available but in crystal reports
some events like Formatsection,Initreprt are available in the crystal report .cs file but nothing works.

 

How can i achieve in this crystal report. Please help me.

Error Code 64: Host not available

$
0
0

Hello

 

I am trying to setup a website using asp. Local every things runs ok.

 

On our isp server the runtime version was not available, and there were a lot of missing files.

 

That problem is no solved.

 

For a test I made 1 aspx page with an empty report (no connection, no data just some text)

 

so i have 1 default.aspx page and 1 CrystalReport1.rpt

 

Running this page gives: Error Code 64: Host not available.

 

Doe anyone has any suggestions where to look for ?

 

Thanks,

 

Leon


Font rendering quality barcode

$
0
0

I have a strange problem. When I use the old RDC to print a report, everything is ok.

When I use the current .NET viewer and print from the preview, everything is also ok.

Only when I use the Report.PrintToPrinter method directly then the barcode is wrong.

 

Here are two examples:

 

OK:

EAN Barcode_ok.jpg

 

Wrong:

EAN Barcode_wrong.jpg

 

You can see that also the width is wrong.

The rest of the report is ok.

Any hints on what I can check?

RecordSelectionFormula disappears VB.NET 2010

$
0
0

I am getting myself more confused as I read about how to properly view a report in VB.NET Crystal Reports Viewer.  So it's now time I ask for some help.

First, I am using VB.NET 2010 with CR for VS 13.0.9.1312 installed and I have the runtime files installed as well.  I am having problems with several things but I will only put on issue in a thread for ease of tracking.

 

Scenario:  The viewer I am creating will use a MySQL database and/or csv files.  I have my program creating the DSN entries and have confirmed they work properly.  With some help of people here, I am able to switch the reports to the proper DSN as needed (you will see this in the code below).  All reports are external and may or may not have been created by me.  The program will allow users to run any report they wish to create.  Therefore, I will not know anything about the report including the DSN before it is run.  I cannot pass parameters from my program because I will not know ahead of time what parameters exist and what information to prompt for.  So I am letting the report itself trigger the prompts for the parameters.  Almost all of this is working fine when I have the report set to preview mode on screen.

 

The issue:  It is ignoring the record selection formula in each report so that it brings back all records, unless I specifically tell the viewer what the record selection formula is while running the report.  I am using the ReportDocument and thought that the ReportDocument.RecordSelectionFormula in it would carry through, but when I put the RecordSelectionFormula on the report itself, it is blank until I assign it to the viewer control.  Parameters used outside the RecordSelectionFormula are prompted and used properly in my testing so far, but not the one's inside.

 

So my two questions are:

1) Is there anything that I should consider changing to make the code below work better in general?  Maybe the order of the commands is causing a problem?

2) Why would I have to assign the line below (test = a string containing the original recordselectionformula of the report from just after loading.  I'll rename it later if I have to keep it)?

 

         crViewer.SelectionFormula = test

 

 

Public Sub DBLogin(ByVal strCRReport As String, _
                      ByVal strServerName As String, _
                      ByVal strDatabaseName As String, _
                      ByVal strUserid As String, _
                      ByVal strPassword As String)
      'sets up login for database
      'check each report for current

      Dim strcsvDatabaseName As String = FindFormsDSNPath()

      Dim strcsvServerName As String = cstrProgramTitle & " CSV Forms"


      crReport.Close()

 

      Try

         crReport.Load(strCRReport)
         crReport.ReportOptions.EnableSaveDataWithReport = False

         Dim x As Integer = crReport.Subreports.Count

         x = crReport.DataDefinition.ParameterFields.Count
        

         Dim strReportDSN As String '= GetReportDSN

         sslblFilename.Text = strFileName & " - CR " & crReport.ReportClientDocument.MajorVersion & "." & crReport.ReportClientDocument.MinorVersion


         Dim crTableLogonInfo As TableLogOnInfo

         'Set the database properties and security credentials
         Dim crConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
         crConnectionInfo.ServerName = strServerName
         crConnectionInfo.DatabaseName = strDatabaseName
         crConnectionInfo.UserID = strUserid
         crConnectionInfo.Password = strPassword


         Dim csvConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
         csvConnectionInfo.ServerName = strcsvServerName
         csvConnectionInfo.DatabaseName = strcsvDatabaseName
         csvConnectionInfo.UserID = ""
         csvConnectionInfo.Password = ""


         'Apply the ConnectionInfo to the report tables
         Dim crTables As CrystalDecisions.CrystalReports.Engine.Tables
         Dim crTable As CrystalDecisions.CrystalReports.Engine.Table

         crTables = crReport.Database.Tables

         crTable = crTables(0)
         strReportDSN = crTable.LogOnInfo.ConnectionInfo.ServerName
         strReportDSN = GetReportDSN(strReportDSN)


         Dim blntemp As Boolean
         For Each crTable In crTables
            blntemp = False
            crTableLogonInfo = crTable.LogOnInfo
            If strReportDSN = strServerName Then
               crTableLogonInfo.ConnectionInfo = crConnectionInfo
            Else
               crTableLogonInfo.ConnectionInfo = csvConnectionInfo
            End If
            crTable.ApplyLogOnInfo(crTableLogonInfo)

            blntemp = crTable.TestConnectivity()
         Next


         Dim mySubReport As CrystalDecisions.CrystalReports.Engine.ReportDocument

         Dim mySubReports As CrystalDecisions.CrystalReports.Engine.Subreports


         mysubreports = crReport.Subreports
         For Each mySubReport In mySubReports


            Dim crsubTables As CrystalDecisions.CrystalReports.Engine.Tables
            Dim crsubTable As CrystalDecisions.CrystalReports.Engine.Table

            mySubReport = crReport.OpenSubreport(mySubReport.Name)

            'find current DSN
            crsubTables = mySubReport.Database.Tables
            crsubTable = crsubTables(0)
            strReportDSN = crsubTable.LogOnInfo.ConnectionInfo.ServerName
            strReportDSN = GetReportDSN(strReportDSN)


            For Each crsubTable In crsubTables
               blntemp = False
              
               crTableLogonInfo = crsubTable.LogOnInfo

               'Reset DSN to program connection for database or csv files
               If strReportDSN = strServerName Then
                  crTableLogonInfo.ConnectionInfo = crConnectionInfo
               Else
                  crTableLogonInfo.ConnectionInfo = csvConnectionInfo
               End If
               crsubTable.ApplyLogOnInfo(crTableLogonInfo)

               blntemp = crsubTable.TestConnectivity()
            Next
         Next

         'Find the RecordSelectionFormula and test if it carries through

         Dim test As String = crReport.RecordSelectionFormula


         'check if to be sent direct to printer and send all pages
         If Not autoforms Is Nothing AndAlso autoforms.ToPrinter Then
            crReport.PrintOptions.PrinterName = autoforms.Printer
            crReport.PrintToPrinter(1, True, 0, 0)

         End If


         'check if to be sent direct to pdf and send all pages
         If Not autoforms Is Nothing AndAlso autoforms.ToPDF Then

            Dim strPDFFilename As String = autoforms.PDFPath & "\" & autoforms.ReportName & " " & autoforms.ReportType & ".pdf"
            strPDFFilename = Replace(strPDFFilename, " ", "_")
           
            SendExport(strPDFFilename, "PDF")

         End If


         'if not preview then close form
         If Not autoforms Is Nothing AndAlso Not autoforms.Preview Then
            Me.Close()
         End If
        
         'setup viewer options
         crViewer.ReportSource = Nothing
         crViewer.ReportSource = crReport

         Dim intExportFormatFlags As Integer
         intExportFormatFlags = ViewerExportFormats.PdfFormat Or
                                 ViewerExportFormats.ExcelFormat Or
                                 ViewerExportFormats.ExcelRecordFormat Or
                                 ViewerExportFormats.XLSXFormat Or
                                 ViewerExportFormats.CsvFormat

         crViewer.AllowedExportFormats = intExportFormatFlags
         crViewer.ShowLogo = False

'Note first line here does not work, but second one does
         'crReport.RecordSelectionFormula = test
         crViewer.SelectionFormula = test

         crViewer.Refresh()
         crViewer.Show()

      Catch ex As Exception
         MessageBox.Show(ex.Message & vbCrLf & ex.ToString)

      End Try

     

   End Sub

 

 

All help is appreciated.  TIA, rasinc

Difference between Crystal Report with VS2010 and Crystal Report Professional Version

$
0
0

Dear Experts,

 

We want to know the difference between Crystal Report Version with VS 2010 and Crystal Report Profesional Version.

 

And from where we should buy it provide the link.

 

Thanking you,

Miral Shah

Failed to load database information. Error in File temp_

$
0
0

Our environment:

 

Windows Server 2012 R2 Data-center Edition 64 bit

Visual Studio Pro 2013 Version 12.0.3.30110.00 Update 1

.Net 4.5.51641

Crystal Reports for VS 2013 V13.0.9.1312

Oracle ODAC 11.2.0

 

We created a winform application to generate a form letter report that runs fine within the IDE. When we build the the exe and copy it from the project folder to a folder on the C:\drive of this same pc and try to execute it we get these error messages (partial list);

 

CrystalDecisions.CrystalReports.Engine.DataSourceException: Failed to load database information.

Error in File temp_d55286fc-26ee-4216-9062-3e32380313ab {B640FD39-66AC-4B6E-995D-7218BB48A992}.rpt:

Failed to load database information. ---> System.Runtime.InteropServices.COMException: Failed to load database information.

Error in File temp_d55286fc-26ee-4216-9062-3e32380313ab {B640FD39-66AC-4B6E-995D-7218BB48A992}.rpt:

Failed to load database information.

   at CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.ReplaceConnection(Object oldConnection, Object newConnection, Object parameterFields, Object crDBOptionUseDefault)

   at CrystalDecisions.CrystalReports.Engine.Table.SetDataSource(Object val, Type type)

   at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)

   --- End of inner exception stack trace ---

   at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)

   at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(Object val, Type type)

   at CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataSet dataSet)

   at cr3Test.Form1.Form1_Load(Object sender, EventArgs e)

 

Here is the app:

 

Imports System.Data.OleDb

Imports System.Data

Imports System

Imports System.Windows.Forms

Imports CrystalDecisions.CrystalReports.Engine

Imports CrystalDecisions.Shared

Public Class Form1

 

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load

        Dim crReportDocument As New CrystalReport3()

        Dim DataSet1 As DataSet

        Dim adoOleDbConnection As OleDbConnection

        Dim adoOleDbDataAdapter As OleDbDataAdapter

 

        Dim connectionString As String = ""

        connectionString = "Provider=OraOLEDB.Oracle;"

        connectionString += "Data Source=ourdb;"

        connectionString += "User ID=ouruserid;Password=ourpsw"

        adoOleDbConnection = New OleDbConnection(connectionString)

        Dim sqlString As String = "select * from TEMP_FRI_LETTERS"

        adoOleDbDataAdapter = New OleDbDataAdapter(sqlString, adoOleDbConnection)

        DataSet1 = New DataSet()

        adoOleDbDataAdapter.Fill(DataSet1, "TEMP_FRI_LETTERS")

        'Dim xmlPath As String = "C:\Temp\test.xml" ' use these two statment s to verify dataset works

        'DataSet1.WriteXml(xmlPath, XmlWriteMode.WriteSchema)

 

        crReportDocument.SetDataSource(DataSet1)

        crReportDocument.PrintOptions.PrinterName = "HP_LaserJet_4350_PCL_5e_Info_Tech"

        crReportDocument.Refresh()

        crReportDocument.PrintToPrinter(1, False, 0, 0)

 

        DataSet1.Dispose()

        adoOleDbDataAdapter.Dispose()

        adoOleDbConnection.Close()

        adoOleDbConnection.Dispose()

        crReportDocument.Dispose()

 

        Me.Close()

 

    End Sub

End Class

 

Here is the app.config:

 

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

    <startup useLegacyV2RuntimeActivationPolicy="true">

        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />

    </startup>

    <system.windows.forms jitDebugging="true" />

</configuration>

 

We have the CPU set to x86 as we are ultimately trying to generate a 32 bit app for XP and Win 7. We only installed the 32 bit run time on this pc because we have no intention of going to 64 bit apps on the clients. Are there additional dlls or something that has to be installed in the same folder as the exe on this development machine.

 

Bruce

Crystal Reports WPF Export Options Destination and Formating

$
0
0

i would like to know how to add the destination options and formatting

when exporting from crystal reports for Visual Studio WPF version

 

specifically export to microsoft excel

 

so far the only thing i could place is the showexport button option and

i would like to know if this is possible in the wpf version as ive seen it on earlier

visual studio 6

 

export.PNG

export2.PNG

Pass more than two parameters to Crystal Reports from VB.NET

$
0
0

Below is my code in VB.NET 2010 to pass parameters in Crystal Report.

All the way I am able to pass one parameter in report which is packing_size (I have created packing_size field in Crystal Reports Parameter Fields)

Now I want to pass a second parameter with AND or OR condition.

Can I get help?

I have come all the way at 99% I want to complete it @100%, PLEASE HELP

Code as below:

 

Imports System.Data.OleDb
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared

PublicClass frmrptProducts
PrivateSub frmrptProducts_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)HandlesMyBase.Load

  
Dim cryRpt AsNew ReportDocument
  
Dim CrTables As Tables
  
Dim crtableLogoninfo AsNew TableLogOnInfo
  
Dim crConnectionInfo AsNew ConnectionInfo

  
'load report
  cryRpt
.Load(ReportPath &"CRproducts.rpt")

  
'Connection
  
With crConnectionInfo
  
.ServerName = My.Application.Info.DirectoryPath.ToString()&"\data\db.mdb"
  
'.DatabaseName = ""
  
'.UserID = ""
  
.Password =""
  
EndWith

  
'Passing parameters code starts here
  
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
  
Dim crParameterFieldDefinition As ParameterFieldDefinition
  
Dim crParameterValues AsNew ParameterValues
  
Dim crParameterDiscreteValue AsNew ParameterDiscreteValue

  crParameterDiscreteValue
.Value ="200"
  crParameterFieldDefinitions
= cryRpt.DataDefinition.ParameterFields
  crParameterFieldDefinition
= crParameterFieldDefinitions.Item("packing_size")'
  crParameterValues
= crParameterFieldDefinition.CurrentValues

  crParameterValues
.Clear()
  crParameterValues
.Add(crParameterDiscreteValue)
  crParameterFieldDefinition
.ApplyCurrentValues(crParameterValues)
  
'Passing parameters code ends here

  CRV
.ReportSource = cryRpt
  CRV
.Refresh()

  
'Catch ex As Exception
  
' MsgBox(ex.Message)
  
'End Try

EndSub

EndClass

Problem With Crystal Reports 10.5 and Windows Server 2012

$
0
0

I have a web application written in Visual Studio 2008 using Crystal Reports 10.5. Recenty my ISP upgraded their server to Windows Server 2012 and my reports no longer display correctly and I get an error when I try to print or export them.

 

Is it possible to keep the application in VS2008 but upgrade the Crystal Reports part to a new version that will run on the 2012 server?

 

Thanks,

 

Carolyn O


Sap Crystal Report Max Print Exception

$
0
0

In Sap Crystal Report after 60 to 70 reports print report doesn't show. When I set registry value of PrintJobLimit from c# code then exception fire "User can't authorize or permit for edit".

Report viewer "Go To Next Page" button always load Page2 with Crystal Reports Runtime version 10.0.10. No problem with Crystal Reports Runtime version 10.0.5

$
0
0

Report viewer "Go To Next Page" button always load Page2 with Crystal Reports Runtime version 10.0.10. No problem with Crystal Reports Runtime version 10.0.5.

 

NOTE: I did not check other Crystal Runtime versions.

 

Any solution?

Crystal Report Viewer (Runtime engine for .NET Framework 4) v 13.0.3.612 Does not advance past page 32767 using Group Tree or Find

$
0
0

I am experiencing a problem when running a very large report through Crystal Report Viewer v 13.0.3.612.   The report pulls all information and if I use the page advancement buttons (START, forward 1 page, backward 1 page, END) I am able to go to any page.   Likewise, I can enter a given page number and it will move that that page.

 

My issue is that when I use the Group Tree to touch on a group that is on a page AFTER 32,767 (the full page count is 43,424).  Likewise, if I attempt to search for text in the report that I know exists on a page after page 32,767 I received the message "Finished Searching the document".

 

If I run the report in Crystal Reports version 2011 (the version I used to create/modify the report), I have no issues with advancing to any page using the Group Tree.

 

Does anyone know what setting change may be needed (registry) to address the Viewer issue?

SP parameters order

$
0
0

Hi! I have a report that works fine in designer, but when used in a web app, the parameters are sent in the wrong order to the stored procedure. I can see with SQL profiler that the parameters returned by sp_procedure_params_90_rowset  have the right position. I can see in the designer that the ordering is ok (even when I change it..it doesn't change the order the params are sent to the SP).

 

I'm running on 11.5.12.1838. All other reports we have are fine. I tried the broken report with OLEDB or native and that didn't change anything.

 

I'm running out of things to try. Anyone had that issue before ? How did you solve it?

SP signature is :

ALTER procedure [dbo].[spr_GetOTSales_stores_compare]

  @store_id int=0,

  @period_no int=0,

  @language_cl varchar(8)='ENGLISH'

as

begin

 

Profiler logs this from CR:

exec "OTRHP"."dbo"."spr_GetOTSales_stores_compare";1 'ENGLISH', 201406, 0

 

which gives

Error converting data type varchar to int.

 

that CR reports as Database Connector Error [Database Vendor Code: 8114]

 

Thanks

Crystal Reports 10, runtime and .NET

$
0
0

We are currently using Visual Studio 2003 programs on a 2003 web server with IIS 6 and .NET 1.1.  My understanding is that crystalreports10_net_embeddedinstall.msi was installed on the server for the runtime reports.  Now we want to create the same set up on a Windows Server 2008 - 32bit.  I noticed a chart on this discussion board that shows the supported OS for CR 10.0.x does not include Server 2008.  I just wanted to confirm that the CR10 runtime install will not work on a Windows Server 2008?  Is there anywhere I can see a list of the files associated with this msi install?  My CR version is 10.0.0.533.

Viewing all 2556 articles
Browse latest View live


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