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

Installation problems with Crystal Reports For Visual Studio (CR - 2013, VS 2012)

$
0
0

I am obviously not including the right files when creating my installation program.

I do have InstallShield Express 2014 but am not familiar with using merge modules.

I really could use a hand stepping me through the process. I am willing to purchase per instance support if necessary.


Error - Could not find crdb_adoplus.dll or one of its dependencies

$
0
0

It all started last week. I am writing a Windows application with VS 2012. This application has several reports. There is a particular report that has a parameter that I use as the header. In the Form Load event handler of the form that displays the report, I set the parameter with the line rpt.SetParameterValue(0, strHeader), where rpt is the instance of the report, and strHeader holds whatever I want the header to be.

 

This was working great. Last week I tweaked the report to and a line feed after the text in a field in the dataset. This had nothing to do with the header. After making this change, when I open the form with the report on it, I am prompted to enter the value for the parameter. I can find no reason for this. I put the line that opens the form with the report on it elsewhere in the application, and was not prompted for the parameter value. This is not an acceptable fix, though. I deleted the contents of the bin folder in the project’s folder, but got the same behavior.

 

I tried writing a simple application to explore different ways of setting the header. I thought I could put the text that I want as the header in a table, then use that in the header in the report. Here is the code:

 

Imports CrystalDecisions.CrystalReports.Engine

Imports CrystalDecisions.Shared

Imports CrystalDecisions.ReportSource

Imports System.Data.SqlServerCe

 

Public Class Form1

 

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

 

        Dim con As New SqlCeConnection

        Dim t As New TestBirdDBDataSetTableAdapters.tblReportHeaderTableAdapter

        Dim rpt As New CrystalReport1

        Dim ds As New TestBirdDBDataSet

 

con.ConnectionString = "Data Source=|DataDirectory|\TestBirdDB.sdf"

        con.Open()

        t.Connection = con

t.Fill(ds.tblReportHeader)

        con.Close()

rpt.SetDataSource(ds)

CrystalReportViewer1.ReportSource = rpt

 

    End Sub

End Class

 

I get the following error when rpt.SetDataSource(ds) executes:

 

CR Error.jpg

 

I have added all of the Crystal Reports references to the project.

 

I was using CR 13.08, upgraded to CR 13.0.10. No difference.

 

Could someone help me figure out 1) Why am I getting prompted for the parameter when it is being set in code, and 2) Why am I getting the error message in my simple test program?

 

Thank you

Problem showing the crystal report viewer in form after added the component on it

$
0
0

Greetings

 

I have a problem running a program. I created a form which I added the component Crystal Report Viewer perfecty but during program execution when I call that form my VS 2012 Ultimate show the following error:

 

Translated:

Failed to createthe form.SeeException.InnerExceptionfor details. Error:An exception occurredin thetype initializer for'CrystalDecisions.Shared.SharedUtils'.


Note: If I remove the component from the form. the applications runs fine when calling the form without the component CrystalReportViewer

error1.jpg

It is something related to my VS? o just that the actual version 13.0.9 is not yet compatible?

Being prompted for a parameter

$
0
0

Hi, Ludek,

 

I hope it's okay, but I thought it would be better to start a new post about the parameter issue.

 

To recap, the issue is:

 

I am writing a Windows application with VS 2012. This application has several reports. There is a particular report that has a parameter that I use as the header. In the Form Load event handler of the form that displays the report, I set the parameter with the line rpt.SetParameterValue(0, strHeader), where rpt is the instance of the report, and strHeader holds whatever I want the header to be.

 

 

 

This was working great. Last week I tweaked the report to and a line feed after the text in a field in the dataset. This had nothing to do with the header. After making this change, when I open the form with the report on it, I am prompted to enter the value for the parameter. I can find no reason for this. I put the line that opens the form with the report on it elsewhere in the application, and was not prompted for the parameter value. This is not an acceptable fix, though. I deleted the contents of the bin folder in the project’s folder, but got the same behavior.

 

The code I posted was the code that generated the .dll error, not the code working with parameters.

 

This is the code working with parameters:

 

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

 

        Dim rpt As New rptAppointments

        Dim strHeader as String

     

        ' I populate the dataset, ds

 

        strHeader = "All appointments"

        rpt.Load()

       rpt.SetParameterValue(0, strHeader)

       rpt.SetDataSource(ds)

       CrystalReportViewer1.Dock = Windows.Forms.DockStyle.Fill

       CrystalReportViewer1.ReportSource = rpt

       CrystalReportViewer1.Visible = True

 

    End Sub

 

You said:

 

Invariably, when you pass a value to the report, and the report prompts anyhow, either the type of the value is incorrect, or the parameter is assigned our of scope, so the engine has no idea it was assigned. Stepping through the code may help determine what is actually happening.

 

The parameter is of string type. How do you specify the scope of a parameter?

 

 

Thanks,

 

Ralph

Load page by page in crystal report viewer

$
0
0

Hi All,

 

     Can anyone help me with the SDK code to display a crystal report with huge volume of data in crystal report viewer. The crystal report viewer should launch first and load data page by page instead of loading the report completely and then launching the crystal report viewer.

 

Currently when I select the necessary parameters and run the report in portal it says "loading" for some time and then launches the crystal report viewer. Is it feasible to open the crystal report viewer immediately after I select the parameter and Click continue, and then load the report page by page.  Any help is really appreciated as I am stuck in this issue for a long time.

 

Please let me know if i am not clear.

 

 

Thansk in Advance!

 

Regards,

Mirthu

Parameter selection values not displayed after migration from Crystal ActiveX Viewer to .Net Viewer

$
0
0

Our software has a screen embedded within it where the customer can run their Crystal reports, this used the ActiveX/COM report viewer which worked well enough and the customer was happy.

 

Because the ActiveX/COM report viewer is now obsolete we built a screen using the new .Net viewer.

 

Unfortunately the customer is now very unhappy because the .Net viewer is not displaying the selection criteria very well.

 

For example:

They have a report of sales for a branch, when they run the report the choose the branch to report on.
In the old screen using the ActiveX/COM viewer the report displayed a list of branches and they picked one from the list - see below:

ActiveX.jpg

 

 

In the new screen using the .Net Viewer they don't get a list, they have to type in the branch number - see below:

DotNet.jpg

 

I've spent two hours searching the SAP site for answers and found nothing - I expect the answer is in there somewhere but I can't find it.

Has any experience this?

I don't know if this a deficiency in the .Net viewer or something I haven't done.

Any help gratefully received!

Printing with crystal reports

$
0
0

when i click on print report it pops up export to pdf. i just want to print directly

Columns' width at runtime

$
0
0

I have a report with the option "Format with Multiple Columns" checked. In the "Layout" tab I've manually set the width of the column, but the actual width of the column will only be determined at runtime.

Remarks: in my report I need always 3 columns, but I want a customizable width. "Can grow" option on a field not work, because the second column overlap the first one.

How can I change the width of the column at runtime? It's possible?
There is another way to create a report with a runtime-determined number of columns/width?


[Crystal Reports for .NET Framework 4.0 on Visual Studio 2010 Professional.]


Report Viewer for ASP.NET vNEXT

$
0
0

With ASP.NET vNext slated for release in early 2015, it brings with it some nice enchantments and deprecation of  features. One of the deprecated items is the WebForms runtime or rather the System.Web assembly. Since the current Report viewer for requires a WebForms runtime, I was wondering if there will be a feature-complete Report Viewer specifically for the OWIN/ASP.NET vNext pipeline?

Using Crystal Report in ASP.Net website, Report not showing in CrystalReportViewer

$
0
0

I am working on an ASP.Net website to display a Crystal Report in a CrystalReportViewer on a ASP.Net page.

 

I am using Visual Studio 2013 and Crystal Reports 2011 for Sage.

 

I have Crystal Reports for Visual Studio version 13.0.2000.0 installed.

 

Trying run the Website on a Win 7 Pro in the local IIS.

 

On the Test1.aspx page, there are 2 DropDownList boxes for the user to filter the data for the report.  When the user clicks on Run Report button, it does the following:

 

1. Connect to the Oracle database.

2. Run a query using a SELECT statement based on what the user selected in the DropDownList boxes.

3. Fill a dataset with the results of the query.

4. Set the CrystalReportViewer to the dataset.

 

CrystalReportViewer is not even shown on the web page.

 

I know the dataset is getting data because I can display it in a label.

 

What do I need to do to get this to work?

 

Test1.aspx  ------

 

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Test1.aspx.vb" Inherits="Test1" %>

 

 

<%@ Register assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>

 

 

<!DOCTYPE html>

 

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

</head>

<body>

    <form id="form1" runat="server">

    <div>

   

        Plex H Shipment YM SUM Report<br />

        <br />

   

        Year:

        <asp:DropDownList ID="ddlYear" runat="server">

        </asp:DropDownList>

        <br />

        Month:

        <asp:DropDownList ID="ddlMonth" runat="server">

            <asp:ListItem Selected="True">ALL</asp:ListItem>

            <asp:ListItem>1</asp:ListItem>

            <asp:ListItem>2</asp:ListItem>

            <asp:ListItem>3</asp:ListItem>

            <asp:ListItem>4</asp:ListItem>

            <asp:ListItem>5</asp:ListItem>

            <asp:ListItem>6</asp:ListItem>

            <asp:ListItem>7</asp:ListItem>

            <asp:ListItem>8</asp:ListItem>

            <asp:ListItem>9</asp:ListItem>

            <asp:ListItem>10</asp:ListItem>

            <asp:ListItem>11</asp:ListItem>

            <asp:ListItem>12</asp:ListItem>

        </asp:DropDownList>

        <br />

        <br />

           

        <asp:Button ID="Button1" runat="server" Text="Run Report" />

        <br />

        <br />

        <asp:Label ID="Label1" runat="server"></asp:Label>

        <br />

        <asp:Label ID="Label2" runat="server"></asp:Label>

   

        <br />

        <br />

        <asp:Label ID="Label3" runat="server"></asp:Label>

        <br />

   

        <br />

        <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" GroupTreeImagesFolderUrl="" Height="962px" ReportSourceID="CrystalReportSource1" ToolbarImagesFolderUrl="" ToolPanelWidth="200px" Width="1344px" EnableDatabaseLogonPrompt="False" EnableParameterPrompt="False" ToolPanelView="None" />

   

        <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">

            <Report FileName="PlexHShipmentYMSumReport_2.rpt">

            </Report>

        </CR:CrystalReportSource>

   

    </div>

    </form>

</body>

</html>

------------------------------------------------------------------------------------------------

 

Test1.aspx.vb -----

 

Imports CrystalDecisions.CrystalReports.Engine

 

 

Partial Class Test1

    Inherits System.Web.UI.Page

 

 

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load

        Dim strCurYear As String

        Dim intYear As String

 

 

        'Get current Year.

        strCurYear = Format(Now, "yyyy")

 

 

        If ddlYear.Items.Count = 0 Then

 

 

            'Add Items to Year Drop Down List.

            ddlYear.Items.Add("ALL")

            ddlYear.Items.Add(strCurYear)

 

 

            intYear = Val(strCurYear) - 1

            Do While intYear >= 2012

                ddlYear.Items.Add(Trim(Str(intYear)))

                intYear = intYear - 1

            Loop

        End If

 

 

 

 

    End Sub

 

 

    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Dim sql As String

        Dim strProcedure As String

        Dim strYear As String, strMonth As String

        Dim strErrorMsg As String

        strProcedure = "btnRunReport_Click"

 

 

        Try

            sql = ""

 

 

            strYear = ddlYear.Text

            strMonth = ddlMonth.Text

 

 

            sql = "SELECT SHIP_YEAR, SHIP_MONTH, SHIP_TO_BUILDING_CODE, TRUCK_CNT, INTERPLANT_SHIPPER_NO_CNT, " & _

                "TOTAL_ITEM_CNT, GTOT_NET_WEIGHT, GTOT_GROSS_WEIGHT, ENTRY_DATE, REVISE_DATE " & _

                "FROM VIEW_PLEX_H_SHIPMENT_YM_SUM "

 

 

            If strYear = "ALL" And strMonth <> "ALL" Then

                sql = sql & "WHERE SHIP_MONTH = '" & strMonth & "' "

            ElseIf strYear <> "ALL" And strMonth = "ALL" Then

                sql = sql & "WHERE SHIP_YEAR = '" & strYear & "' "

            ElseIf strYear <> "ALL" And strMonth <> "ALL" Then

                sql = sql & "WHERE SHIP_YEAR = '" & strYear & "' AND SHIP_MONTH = '" & strMonth & "' "

            End If

 

 

            sql = sql & "ORDER BY SHIP_YEAR ASC, SHIP_MONTH ASC"

 

 

            Label1.Text = "SQL Statement is:"

            Label2.Text = sql

            Call CreateReport2(sql)

 

 

ExitReport:

 

 

        Catch ex As Exception

            'strErrorMsg = "Date/Time: " & Format(Now, "MM/dd/yyyy HH:mm:ss") & vbCrLf & _

            '            "Procedure: " & strProcedure & vbCrLf & _

            '            "Application: " & strAppName & vbCrLf & _

            '            "Error Message: " & ex.Message & vbCrLf & vbCrLf

            'My.Computer.FileSystem.WriteAllText(strCurPath + "\" + strErrorLogFile, strErrorMsg, True)

        End Try

    End Sub

    Protected Sub CreateReport(ByVal strSql As String)

    End Sub

    Protected Sub CreateReport2(ByVal strSQL As String)

        Dim OrConn As Oracle.ManagedDataAccess.Client.OracleConnection

        Dim OrCmd As Oracle.ManagedDataAccess.Client.OracleCommand

        Dim OrDa As Oracle.ManagedDataAccess.Client.OracleDataAdapter

        Dim OrCB As Oracle.ManagedDataAccess.Client.OracleCommandBuilder

        Dim Rpt1 As ReportDocument

 

 

        OrConn = New Oracle.ManagedDataAccess.Client.OracleConnection()

 

 

        If IsNothing(Rpt1) Then

            Rpt1 = New ReportDocument

        End If

 

 

        If OrConn.State <> Data.ConnectionState.Open Then

            'Connection string using ODBC

            'OrConn.ConnectionString = "DATA SOURCE=GTRANS01;PERSIST SECURITY INFO=True;USER ID=GADMIN;PASSWORD=GADMINPASS;"

 

 

            'Connection string without using ODBC

            OrConn.ConnectionString = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=999.8.7.65)(PORT=999)))(CONNECT_DATA=(SERVICE_NAME=Z99)));User Id=user;Password=password;"

 

 

            OrConn.Open()

        End If

 

 

        OrCmd = New Oracle.ManagedDataAccess.Client.OracleCommand(strSQL, OrConn)

        OrCmd.CommandType = Data.CommandType.Text

        OrDa = New Oracle.ManagedDataAccess.Client.OracleDataAdapter(OrCmd)

 

 

        OrCB = New Oracle.ManagedDataAccess.Client.OracleCommandBuilder(OrDa)

 

 

        Dim dsData As New Dataset1()

        dsData.DataSetName = "PlexHShipmentYMSumData"

        OrDa.Fill(dsData)

 

 

        Label3.Text = "Dataset has " & dsData.Tables(0).Rows.Count & " records."

 

 

        Rpt1.Load(Server.MapPath("PlexHShipmentYWSumReport_2.rpt"))

        Rpt1.SetDatabaseLogon("user", "password")

        Rpt1.SetDataSource(dsData.Tables(0))

 

 

        CrystalReportViewer1.ReportSource = Rpt1

 

 

    End Sub

End Class

Gray color background in PDF exported from Crystal Report not printing correctly in Digital Printer (CMYK)

$
0
0

I am processing a crystal report on RAS server,and exporting it to PDF, using the RAS Dlls.

 

Dim Report As ReportClientDocument
Dim crExportData As New ByteArray
Dim crExportType As CrReportExportFormatEnum

crExportType = CrReportExportFormatEnum.crReportExportFormatPDF
crExportData = Report.PrintOutputController.Export(crExportType)

 

A gray background is applied to an object in crystal report, with RGB color code (216,216,216).

 

On exporting this report to pdf, the color appears as required.

 

However, when printing this PDF in a digital printer (uses CMYK color format), the color changes to Pinkish Gray.

 

The color remains gray as required, in other printers.

 

Is there any way to make the exported PDF CMYK compliant?

 

Please help.

CR for VS2005 upgrade to VS2010 to VS2013

$
0
0

Hi all

 

Recently I took over an old project which was developed on VS 2005 using Crystal Report XI (separate purchase) 7 years ago. I have imported the project into VS 2010 and replace the CR 11.5 with CR 13 (that came with VS 2010).

 

I realised some of the reports had the option 'Verify on Every Print' checked and in the code, the subroutine VerifyDatabase() was called prior to each print.

 

Question 1.

Can I remove this option 'Verify on Every Print'? With this checked, the report will take triple the time to print.

 

Question 2.

What is the use of this option? I googled for a week and unable to find a good explanation to use and not to use.

 

Question 3.

Can CR 13 (embedded) run on 64-bit Windows 7 and Windows 8/8.1 after upgrading the project file from VS 2005 to VS 2010?

 

Question 4.

If I were to upgrade to VS 2013, will there be any vast speed improvement?

 

Any of your input is appreciated.

 

Please assist me.

Do NOT show Parameter prompt when loading report

$
0
0

Hello,

 

I know there are a million threads on this topic, but that's the problem...it's impossible to find an answer.  So apologies in advance if it's out there already.

 

I have a generic report viewer page/control in my application where I load a variety of reports; I do not know what the parameters are in advance.  In ALL cases, I do NOT want to be prompted for parameters when the report is first loaded.  I want the report to use either empty values or any specific values I pass in via code when the report is first loaded and executed in the Viewer.

 

In one example, the report has one string parameter and 2 numeric parameters.  If I set the string parameter to "", then handle that in my record selection criteria, that is an OK workaround.  But for the numeric parameters, I want to set them to null or nothing and then not be prompted.  This is where I'm having difficulty: If I do nothing, I get prompted. If I set them to Null/Nothing, I'll get an error message when the report loads that there is a data type mismatch.  ALL of the parameters are set to OptionalPrompt=True.  Also, if I set EnableParameterPrompt="False", I receive an error that parameters are missing even though all parameters are Optional.  So the main issue is to be able to set numeric (and date) prompt values to something in code that will then stop them from being prompted in the Report Viewer when the report loads.

 

Thanks in advance for a solution or a pointer to another thread with the solution.

Richard

Problem happening again. The maximum report processing jobs limit configured by your system administrator has been reached.

$
0
0

We have started receiving load report failed error again in one of our production servers. This problem occurred some months ago and on that time we found that in the code reportdocument.close method was not called so we added into the code and set the print job limit to 400 and problem went away for couple of months but now it has started again.

Load report failed.

 

   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()

   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)

   at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)

   at AppSuite.WebApp.CrystalViewer.LoadReport(Boolean bRefresh)

   at AppSuite.WebApp.CrystalViewer.Page_Load(Object sender, EventArgs e)

   at System.Web.UI.Control.OnLoad(EventArgs e)

   at System.Web.UI.Control.LoadRecursive()

   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 

The maximum report processing jobs limit configured by your system administrator has been reached.

 

   at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)

   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)

   at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()

 

This is our code

 

Private m_oReportDocument As New ReportDocument

 

 

    Private ReadOnly Property ReportId() As Integer

        Get

            Return Integer.Parse(Me.Request.QueryString("r"))

        End Get

    End Property

 

 

    Private Property CacheKey() As String

        Get

            Dim sCacheKey As String = Me.Request.QueryString("ck")

            If sCacheKey Is Nothing OrElse sCacheKey.Length = 0 Then

                sCacheKey = CStr(Me.ViewState("CacheKey"))

            End If

            Return sCacheKey

        End Get

        Set(ByVal Value As String)

            Me.ViewState("CacheKey") = Value

        End Set

    End Property

 

 

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

 

 

        If Not Me.IsPostBack Then

            LoadReport()

        End If

 

 

    End Sub

 

 

    Private Sub btnPDF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPDF.Click

 

 

        'Redirect to the PDF Viewer passing it the ReportId and CacheKey

        Me.Response.Redirect(String.Format(ReportHelper.PDFViewerURL, Me.ReportId, Me.CacheKey))

 

 

    End Sub

 

 

    Private Sub btnRTF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRTF.Click

 

 

        'Redirect to the RTF Viewer passing it the ReportId and CacheKey

        Me.Response.Redirect(String.Format(ReportHelper.RTFViewerURL, Me.ReportId, Me.CacheKey))

 

 

    End Sub

    Private Sub btnExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExcel.Click

 

 

        'Redirect to the Excel Viewer passing it the ReportId and CacheKey

        Me.Response.Redirect(String.Format(ReportHelper.ExcelViewerURL, Me.ReportId, Me.CacheKey))

 

 

    End Sub

 

    Private Sub crvMain_Navigate(ByVal source As Object, ByVal e As CrystalDecisions.Web.NavigateEventArgs) Handles crvMain.Navigate

        LoadReport()

    End Sub

 

 

    Private Sub crvMain_Search(ByVal source As Object, ByVal e As CrystalDecisions.Web.SearchEventArgs) Handles crvMain.Search

        LoadReport()

    End Sub

 

 

    Private Sub crvMain_ViewZoom(ByVal source As Object, ByVal e As CrystalDecisions.Web.ZoomEventArgs) Handles crvMain.ViewZoom

        LoadReport()

    End Sub

 

 

    Private Sub crvMain_Drill(ByVal source As Object, ByVal e As CrystalDecisions.Web.DrillEventArgs) Handles crvMain.Drill

        LoadReport()

    End Sub

 

 

    Private Sub crvMain_DrillDownSubreport(ByVal source As Object, ByVal e As CrystalDecisions.Web.DrillSubreportEventArgs) Handles crvMain.DrillDownSubreport

        LoadReport()

    End Sub

 

 

    Private Sub crvMain_ReportRefresh(ByVal source As Object, ByVal e As CrystalDecisions.Web.ViewerEventArgs) Handles crvMain.ReportRefresh

        LoadReport(True)

    End Sub

 

 

    Private Sub LoadReport()

        LoadReport(False)

    End Sub

 

 

    Private Sub LoadReport(ByVal bRefresh As Boolean)

 

 

        If Common.CouldBeMultiDB(User.Identity.Name) AndAlso TypedSession.OverrideCompany.Length > 0 Then

            Common.Settings.OverrideCompany = TypedSession.OverrideCompany

        End If

 

 

        'Get the report data

        Dim dtReport As DataTable = ReportHelper.GetReportData(Me.CacheKey, bRefresh)

 

 

        'If there is data to display bind it to the Crystal Viewer

        If dtReport.Rows.Count > 0 Then

            With m_oReportDocument

                .Load(ReportHelper.GetReportPath(Me.ReportId))

                .SetDataSource(dtReport)

                .PrintOptions.PaperSize = Common.Settings.CrystalPaperSize

            End With

            crvMain.ReportSource = m_oReportDocument

        Else

            'Hide the controls and display a message if there is no data

            crvMain.Visible = False

            btnPDF.Visible = False

            btnExcel.Visible = False

            lblNoResults.Visible = True

        End If

 

 

    End Sub

 

 

    Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload

        m_oReportDocument.Close()

        m_oReportDocument.Dispose()

 

 

    End Sub

 

Can any one tell if we are doing anything wrong in our code. We don't use sub reports any more however we do use paging and some of our reports have 200+ pages. Also is it possible to find out print job limit and concurrent users by writing some code.

 

Thanks

crystal report: client-side printing problem

$
0
0

Hello everyone,

 

 

I developed an asp.net web application / c # - VS2012 - crystal Repport (CRforVS_13_0_5) on windows 7 pro 32 bits, everything is ok even print reports.

The problem is that when hosting the web application in IIS on the same machine (Windows 7 pro 32 bit) printing the report (crystal report) does not work;

 

my code behind:

 

ReportDocument cryRpt = new ReportDocument;
  string path = "../rpt/demande.rpt";
  cryRpt.Load(Server.MapPath(@path));
  ParameterFieldDefinitions crParameterFieldDefinitions;
  ParameterFieldDefinition crParameterFieldDefinition;
  ParameterValues crParameterValues = new ParameterValues();
  ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();
  crParameterDiscreteValue.Value = "value";
  crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
  crParameterFieldDefinition = crParameterFieldDefinitions["val"];
  crParameterValues = crParameterFieldDefinition.CurrentValues;
  crParameterValues.Clear();
  crParameterValues.Add(crParameterDiscreteValue);
  crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
  cryRpt.SetDatabaseLogon(user, pw);
  CrystalReportViewer1.Visible = true;
  CrystalReportViewer1.ReportSource = cryRpt;
  cryRpt.PrintToPrinter(1, false, 0, 0);


how to print the report on the client side?


Being prompted for a parameter

$
0
0

Hi, Ludek,

 

I hope it's okay, but I thought it would be better to start a new post about the parameter issue.

 

To recap, the issue is:

 

I am writing a Windows application with VS 2012. This application has several reports. There is a particular report that has a parameter that I use as the header. In the Form Load event handler of the form that displays the report, I set the parameter with the line rpt.SetParameterValue(0, strHeader), where rpt is the instance of the report, and strHeader holds whatever I want the header to be.

 

 

 

This was working great. Last week I tweaked the report to and a line feed after the text in a field in the dataset. This had nothing to do with the header. After making this change, when I open the form with the report on it, I am prompted to enter the value for the parameter. I can find no reason for this. I put the line that opens the form with the report on it elsewhere in the application, and was not prompted for the parameter value. This is not an acceptable fix, though. I deleted the contents of the bin folder in the project’s folder, but got the same behavior.

 

The code I posted was the code that generated the .dll error, not the code working with parameters.

 

This is the code working with parameters:

 

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

 

        Dim rpt As New rptAppointments

        Dim strHeader as String

     

        ' I populate the dataset, ds

 

        strHeader = "All appointments"

        rpt.Load()

       rpt.SetParameterValue(0, strHeader)

       rpt.SetDataSource(ds)

       CrystalReportViewer1.Dock = Windows.Forms.DockStyle.Fill

       CrystalReportViewer1.ReportSource = rpt

       CrystalReportViewer1.Visible = True

 

    End Sub

 

You said:

 

Invariably, when you pass a value to the report, and the report prompts anyhow, either the type of the value is incorrect, or the parameter is assigned our of scope, so the engine has no idea it was assigned. Stepping through the code may help determine what is actually happening.

 

The parameter is of string type. How do you specify the scope of a parameter?

 

 

Thanks,

 

Ralph

Crystal Reports 13 for VS2013 Hangs when report deployed via Clickonce

$
0
0

Hi,

 

We have upgraded from vs2008 to vs2013 one of our .net C# projects. Project consist of a Server and a windows client. Reports are run in the client, and data transported with disconnected Datasets ( No direct connection to the database ). We use Microsoft clickonce to deploy this application to our users.

 

The problem we have is that after the migration clients deployed with clickonce experience a delay of about 1 minute while the report is shown with a message "please wait while the document is processing". However if we run the application directly from the filesystem the report is shown immediately.

 

running the clickonce deployed shows the following message using process monitor, however after ~1 minute the report displays correctly.

 

6:08:05.5863138 PMECMWin.exe18156CreateFileMappingD:\Users\o\AppData\Local\Temp\2\temp_6a4d2478-2cab-45d5-8e21-af5d5d3a761a {56013444-9297-4F76-A8DE-00A08C289BBF}.rptFILE LOCKED WITH WRITERSSyncType: SyncTypeCreateSection, PageProtection:

 

 

Code:

 

        CrystalReport1 c = new CrystalReport1();

        public Form1()

        {

            InitializeComponent();

            c.Load();

        }

 

 

        Stopwatch s = new Stopwatch();

        private void Form1_Load(object sender, EventArgs e)

        {          

            if (c.IsLoaded)

            {

                crystalReportViewer1.ReportSource = c.FileName.Replace("rassdk://", ""); ;

                Console.WriteLine("crystalReportViewer1.ReportSource = c;:" + s.Elapsed.TotalMilliseconds.ToString());

            }

        }

 

* Note:

1. the report from the code above is empty and has no connections to database.

2. Using Vs2013

3. Using SAP Crystal Reports, developer version for Microsoft Visual Studio - Service Pack 9 - Fixed Issues and updates - Busines…

EAN13 barcodes not printing or displaying in CR Viewer

$
0
0

I am not sure where to log this & have had no luck on Crystal Reports forum, so am trying here as well!

 

I have designed a Crystal report and have set the printer as the Zebra, and the font as the printer font. While the font display oddly in the designer preview, it prints fine to the Zebra printer.

 

When importing the report into SAP Business One and running from the viewer, the codes' numeric value displays on screen and that is what prints from the printer. Have tried this on the same machine where the designer is installed and from a different machine.

 

The barcodes display from other applications on the same machines, so the fonts must be available.

 

I am using CR2008, which is the latest which is compatible with the customers SAP install.

 

A truetype font I have installed does not print at all

 

Any way to resolve this?

Crystal Report in vb.net using mysql database

$
0
0

     Please help me to build report. i already make but the data was not show.

RAS SDK dlls for projects that target .NET 4.0 framework

$
0
0

Hello,

 

recently, because of needs of our project, we have started using RAS SDK in our application. We are developing in Visual Studio 2010, and have downloaded CR for VS 2010.

However it seems that we can not get expected behavior of, I believe dll in question is  CrystalDecisions.ReportAppServer.ClientDoc, when we target the 4.0 framework in project.

If we change the target platform to 2.0 - 3.5 everything works as expected ( we can search sections, add new...) but in 4.0 exceptions are thrown since

CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument has different information in it.

 

Can you tell me what is the issue? And how to proceed with developing RAS SDK in 4.0 environment?

 

 

Any help highly appreciated!

Viewing all 3636 articles
Browse latest View live


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