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

Blankspaces rendering problem

$
0
0

Hello to Everyone,

 

I have a problem with the rendering of the blank spaces in a report.
I'm working to an old Visual Studio project referenced to .NET framework 4.0 and Crystal report 13.0.2000.
My machine is running with Windows 8.1 update 1 and Crystal report for visual studio 13.0.9 in visual studio 2013 update 2.

 

The principle of "What you see is what you get" is totally not respected because the blank spaces in designer are differently rendered in the pdf report generated. I really don't understand why, maybe because of the .net framework 4.0?

 

If someone could help to figure it out I will be grateful about it.

 

Manuel


Visual Studio 2013, can't see crystal viewer

$
0
0

Version 12.0.21005.1 REL, installed CRforVS_13_0_9, NOTHING Crystal shows up in the toolbox.  Been trying for a LONG time now, just doesn't see it.  I am merely attempting to load the CrystalViewer into a test program, and I can NOT find a way to get it to show up!

 

Any help?  This seems to be unduly frustrating.

 

Nothing in the "Choose Items for .NET"

 

 

Some in the COM, though, load and puton form, get this:

 

 

Not sure where to go from here...  I did this in VS2008, and it seemed to work out of the box.

 

Thanks!

Table.ApplyLogOnInfo() does not apply all ConnectionInfo properties (missing Database Name)

$
0
0

I am writing a Windows Forms desktop application that uses Crystal Reports to display information from a SQL database, but I am having trouble getting my code to work in both my development and production environments.  I set a connection string in the app.config file that is used to connect to a SQL database, and set the logon information for a Crystal Report dynamically in C# before loading it in the application.  My code is as follows:

 

public ReportDocument getReport()

{

     ReportDocument doc = new ReportDocument();

     string filename = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Reports", crReportName);        
     doc.Load(filename);

     //Set Connection Info For Each Table
     doc.DataSourceConnections.Clear();

     foreach (Table crTable in doc.Database.Tables)

     {

           TableLogOnInfo crTableLogonInfo = crTable.LogOnInfo;

           crTableLogonInfo.ConnectionInfo  = getReportConnectionInfo();

           crTable.ApplyLogOnInfo(crTableLogonInfo);

     }

 

     return doc;

}

 

 

private static ConnectionInfo getReportConnectionInfo()

{

            System.Data.Common.DbConnectionStringBuilder builder = new System.Data.Common.DbConnectionStringBuilder();

            builder.ConnectionString = ConfigurationManager.ConnectionStrings["dbConnectionString"].ConnectionString;

            ConnectionInfo crConnectionInfo = new ConnectionInfo();

            crConnectionInfo.ServerName = (string)builder["Data Source"];

            crConnectionInfo.DatabaseName = (string)builder["Initial Catalog"];

            crConnectionInfo.UserID = (string)builder["User Id"];

            crConnectionInfo.Password = (string)builder["Password"];

            crConnectionInfo.IntegratedSecurity = false;

 

          

            return crConnectionInfo;

}

 

 

When I run this code in my development environment, everything works smoothly, and the report is displayed on the screen with the correct information.  However, when I run this code in my production environment, I get a "Database Login" popup with the correct server name and login ID, but with a blank database name.  I've run variations of this code to set each ConnectionInfo property directly to a string, and I've uninstalled/reinstalled different (32 and 64 bit) versions of the Crystal Reports runtime, but I continue to get the same dialog with a blank database name.  What's even more puzzling is that I've successfully deployed this application to another environment (using the same version of the CR Runtime) and everything works fine.  Is there something that I'm not doing in my code?  Has anyone experienced a problem like this in the past?

Crystal Reports assembly (ver 13, 32 bit) does not work on Win7 64bit OS

$
0
0

tried to post, and got an error (unsure if this got posted).

All below is in attachment "Problem submitted to Crystal Reports for Win7 CR assembles raises exception.xml" 

 

Please help.

 

Request/Objective:

-          Application built on win XP using VSTS 2010 needs to work on both desktops:

o   win XP (OS 32 bit) and

o   win7 (OS 64 bit).

-          How to make application that uses Crystal Reports 32 bit assembles work on win7 64 bit desktop.

-          We would like to have only one source control version for both XP and Win7 (64 bit OS).

 

Problem summary:

-          Deployed application works on XP (32 bit OS).

-          Does not work on Win7, see “Win7 (64bit OS) problem details below”

 

Building of App

1.      Application built on win XP VSTS 2010 using Crystal Report assemblies:

·         Install package used/downloaded from Crystal on both XP and win7 Link is:  32bit.msi  (Support Pack 9 (v. 13.0.9.1312)

o E.g. CrystalDecisions.CrystalReports.Engine  Version:  13.0.2000.0

 

2.      VSTS 2010 solution build:

  1. Projects uses “Any CPU”  (no other choices available) as per Project-Properties à Build tab à  Platform: “Active (Any CPU).

 

3.      App installed on both XP and Win7

·         Deployed and works on XP

·         Deployed and does not work on Win7.

 

 

Win7 (64 bit OS) problem details below

Deployed:

·         Installed:  32bit.msi  (Support Pack 9 (v. 13.0.9.1312)

·         Install of app from XP desktop dev PC.

 

Crystal Reports Exception Raised

§  Event Viewer:

Deployed 32bit Crystal Reports distributable.

 

Timestamp: 5/27/2014 8:03:28 PM

Message: System.TypeInitializationException: The type initializer for 'CrystalDecisions.Shared.SharedUtils' threw an exception. ---> System.BadImageFormatException: Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. An attempt was made to load a program with an incorrect format.

   at CrystalDecisions.Shared.SharedUtils..cctor()

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

   at CrystalDecisions.Shared.SharedUtils.GetEffectiveCulture()

   at CrystalDecisions.Shared.LocaleManager..ctor()

   at CrystalDecisions.Windows.Forms.CrystalReportViewer.InitReportViewer()

   at CrystalDecisions.Windows.Forms.CrystalReportViewer..ctor()

   at net.bmogc.cas.ui.ReportViewer.InitializeComponent()

   at net.bmogc.cas.ui.ReportViewer..ctor()

   at net.bmogc.cas.ui.ReportExplorer.OpenFileCall()

   at net.bmogc.cas.ui.ReportExplorer.ListView_MouseDoubleClick(Object sender, MouseEventArgs e)

   at System.Windows.Forms.ListView.WndProc(Message& m)

   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Category: General, UI Events

Priority: 1

EventId: 5002

Severity: Error

Title:CAS UI Exception

Machine: OCVM00000152

Application Domain:

Process Id: 8752

Process Name: C:\Program Files (x86)\BMONB\Commission Accounting System\net.bmogc.cas.ui.exe

Win32 Thread Id: 5828

Thread Name:

Extended Properties:

 

 

Microsoft’s  “Assembly Binding Log Viewer” shows late binding details below

 

*** Assembly Binder Log Entry  (28/05/2014 @ 4:14:29 PM) ***

 

The operation failed.

Bind result: hr = 0x8007000b. An attempt was made to load a program with an incorrect format.

 

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll

Running under executable  C:\Program Files (x86)\BMONB\Commission Accounting System\net.bmogc.cas.ui.exe

--- A detailed error log follows.

 

=== Pre-bind state information ===

LOG: DisplayName = log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304

(Fully-specified)

LOG: Appbase = file:///C:/Program Files (x86)/BMONB/Commission Accounting System/

LOG: Initial PrivatePath = NULL

LOG: Dynamic Base = NULL

LOG: Cache Base = NULL

LOG: AppName = net.bmogc.cas.ui.exe

Calling assembly : CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304.

===

LOG: This bind starts in default load context.

LOG: Using application configuration file: C:\Program Files (x86)\BMONB\Commission Accounting System\net.bmogc.cas.ui.exe.Config

LOG: Using host configuration file:

LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.

LOG: Post-policy reference: log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304

LOG: GAC Lookup was unsuccessful.

LOG: Attempting download of new URL file:///C:/Program Files (x86)/BMONB/Commission Accounting System/log4net.DLL.

LOG: Assembly download was successful. Attempting setup of file: C:\Program Files (x86)\BMONB\Commission Accounting System\log4net.dll

LOG: Entering run-from-source setup phase.

LOG: Assembly Name is: log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304

ERR: Invalid assembly platform or ContentType in file (hr = 0x8007000b).

ERR: Run-from-source setup phase failed with hr = 0x8007000b.

ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.

unable to deserialize Crystal Report (ASP.NET)

ThreadAbortException when using ExportToHttpResponse

$
0
0

I'm trying to export a report to a PDF using ExportToHttpResponse.  It is throwing the ThreadAbortException.  I can catch the error, and keep trucking and it works in debug mode.

 

When I publish to production that error ends the response, hangs the window and the report does not show.

 

I've found lots of info stating that ExportToHttpResponse causes the error, but no information about getting around it...

Is it possible to create a reportviewer directly in javascript?

$
0
0

My scenario:

 

I want to be able to use my custom server (C#, visual studio 2013) application to generate a report based on pre-built Crystal Report 2013 .rpt's. I then want to display that in the front end of my website somehow, using javascript. The quickest solution I have found is to simply export a report to .pdf

 

PDF creation Example (C#):

ReportDocument cryRpt = new ReportDocument();

            cryRpt.Load("Reports/test.rpt");           

            try

            {

                ExportOptions crExportOptions;

                DiskFileDestinationOptions crDiskFileDestinationOptions = new DiskFileDestinationOptions();

                HTMLFormatOptions crFormatTypeOptions = new HTMLFormatOptions();

                crDiskFileDestinationOptions.DiskFileName = "Reports/test_pdf.html";

                crExportOptions = cryRpt.ExportOptions;

            {

                crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;

                crExportOptions.ExportFormatType = ExportFormatType.HTML40;

                crExportOptions.DestinationOptions = crDiskFileDestinationOptions;

                crExportOptions.FormatOptions = crFormatTypeOptions;

            }

                cryRpt.Export();

            }

            catch (Exception ex)

            {

                Console.Write("fail");

            }

 

After it's in PDF form, I can handle it natively in javascript/jquery, in whatever way I need.

 

Question:

What I'd also like to explore is the idea of using a crystalReportViewer, directly in the javascript that makes up the front end of my website, and have my server give me the report source. Is this possible?

Database Logon prompting is in invalid state

$
0
0

Hi

 

 

I have written code in Visual Studio .NET 2010 and downloaded the CrystalDecisions Client components on my local. Our System is working fine with existing Classic ASP code and we are in a plan to upgrade from 2003 to 2008 Server R2. So, thought of to re-write the code from Class Asp to Asp.NET and I am successful in converting the code and was able to execute properly until last friday i.e., 30th May, 2014. But all of a sudden since June 2nd do not know what happened but all the reports are not working as expected and the Crystal viewer is opened up and a dialog opens up as enter the login credentials. Our Login information is giving a userid and password of the DSN created. So, after giving that, the report throws an error saying

 

"Database Logon prompting is in Invalid state".

 

All the reports are in Enterprise Session loaded on a different server.

 

I do not see neither code change in the last 4 days nor there is a change in the Enterprise Console environment. So, I do not know the root cause of the issue. I did googled it but no one had this kind of issue earlier.

 

PLEASE HELP! ITS VERY URGENT.!!!!

 

THANKS

 

-SRINIVASA NADELLA

 

Message was edited by: Ludek Uher


Crystal report viewer are displaying blank page after deploying in web server

$
0
0

Dear friends,

                   i have designed crystal report (in VS2010 &  CRRuntime_64bit_13_0_6 installed in web server) it's working fine in local machine even web server also but in http://localhost, if i change from localhost to my domain name or local IP address(like http://192.168.1.71) then it's getting blank page.

 

but same report if i open in pdf format it's working fine.

 

I have tried the following one. But this is not working for me.

 

Copy the entire Crystal Report Support folder

C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13

 

in web.config, the below code also added.

 

<sectionGroup name="businessObjects">

      <sectionGroup name="crystalReports">

        <section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler" />

      </sectionGroup>

    </sectionGroup>

 

  <crystalReportViewer>
    <add key="resourceURI" value="~/crystalreportviewers13"/>
  </crystalReportViewer>

 

please suggest me some solutions to resolve this issues...

 

Regards,

Manikandan.V

Unsupported Operation Error

$
0
0

Has anyone had the problem of creating a web part using Crystal Viewer, the web page works fine as long as the user is Admin. If a non Admin user tries, I get the Unsupported Operation. A document processed by the JRC engine cannot be opened in the C++ stack. I set full control security on the report folder and \Windows\Temp\   I also tried the ProcessMonitor program looking for access denied errors, none were found. So there must be some security issue somewhere but I do not know where. SharePoint 2010, Visual Studio 2010, Crystal Reports 2011

Crystal reportsError in output window Visual Studio 2013

$
0
0

Hi, I am using Crystal Reports in Visual Studio 2013 (WPF MVVM pattern).

 

In my report viewer, the code that binds to the report viewer is -

 

<ContentControl Grid.Row ="1" Content="{Binding Path=ReportViewer}" >

 

In the view model, this is the code that creates the Report Viewer -

 

       
    public ReportViewerModel(ReportDocument report, string reportName)
    {
        ReportViewer = new CrystalReportsViewer();
        myReport = report;
        _reportName = reportName;      
        ReportViewer.ViewerCore.ReportSource = report;      
    }
       
               

 

I get the following errors in my output window every time the report viewer is loaded

 

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnOpen'); target element is 'Button' (Name='btnOpen'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnPrint'); target element is 'Button' (Name='btnPrint'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnRefresh'); target element is 'Button' (Name='btnRefresh'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnExport'); target element is 'Button' (Name='btnExport'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnCopy'); target element is 'Button' (Name='btnCopy'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='ToggleButton' (Name='btnToggleSidePanel'); target element is 'ToggleButton' (Name='btnToggleSidePanel'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnPrevPage'); target element is 'Button' (Name='btnPrevPage'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name='btnNextPage'); target element is 'Button' (Name='btnNextPage'); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name=''); target element is 'Button' (Name=''); target property is 'Name' (type 'String')

System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=ToolTip; DataItem='Button' (Name=''); target element is 'Button' (Name=''); target property is 'Name' (type 'String')

 

What am I doing wrong? Appreciate any tips!

 

Thanks,
Sharon

RAS 2013

$
0
0

Hi ,

 

i need information how can i install and use RAS 2013 to .net Developer.

 

 

Thansk

fade Ismaeel

Crystal Server or Crystal for Visual Studio?

$
0
0

Hi,

 

We are building a .NET application that requires a Crystal report to be displayed when a link is clicked on. This is a SaaS application and will be hosted in the cloud. We will have many customers that will use this application so needs to support multi-tenancy. I am trying to decide on which version of Crystal Reports to use. I think I have these 2 choices:

 

  1. Crystal Reports Version for Visual Studio
  2. Crystal Reports 2013 and deliver the report using Crystal Server

 

I am unclear as to which solution to use. Do I build the report in VS and deploy it that way on the cloud server or do I build the report using Crystal Reports 2013 and then install Crystal Server on the cloud server, publish the report into it and use OpenDocument or some other way to link the report to the application?

 

Any thoughts would be very welcome.

 

Thanks,

Chris

Failed to load Database information when trying to run a command report

$
0
0

Hi,

 

I created a basic command report connecting to a SQL database using Crystal Reports for Visual Studio 2010 Database Expert>Add Command. When I run this report from my web application(.NET 4.0) it throws an error while loading the report, Failed to load Database information:Error in File ... .rpt

 

When I set the Enable 32 bit applications to true on my Application Pool the report runs fine and also when I preview the report through the design it works fine too.

 

Wonder why I have to Enable 32 bit applications. Doesn't it run on 64 bit apps.

PS: All the other reports designed through the same designer works and runs fine though even on the 64 bit application.

 

My Operating System is Windows 7 Enterprise 64 bit and I have a Crystal Reports runtime for VS 2010 64 bit on that server.

 

Below is the SQL Command Query:

SELECT "CNTCTID"."NAMEFIRST", "CNTCTID"."NAMELAST", "EMPLOYEE"."HIREDATE", "EMPLOYEE"."EMPID"

FROM   (RESOURCES.EMPLOYEE "EMPLOYEE"

               INNER JOIN RESOURCES.CONTACT "CONTACT" ON "EMPLOYEE"."CONTACTKEY"="CONTACT"."CNTCTKEY")

      INNER JOIN RESOURCES.CNTCTID "CNTCTID" ON "CONTACT"."IDKEY"="CNTCTID"."IDKEY"

 

I read somehwere in other forums that

This is due to CR being a 32-bit app running on a 64-bit server.  The server needs to be configured to run 32-bit apps in 32-bit mode.  This is an issue that is not unique to Crystal Reports. Is this really the issue?

 

Please do suggest me.

Barcode not showing from .net

$
0
0

Hello,

 

I have a barcode issue. I have a report made in Crystal Reports XI R2 SP3 using a barcode field.

In the designer the barcode shows correctly.

If I call the report from a visual basic 6.0 application the barcode shows correctly.

If I call the report from a .net application the barcode shows incorrectly !

If I call the report from a .net application and export it to for example Excel the barcode shows correctly.

 

I am not using the builtin .net version of crystal I am using Crystal Reports XI R2 SP3

 

I have tried upgrading Crystal to first sp4 no difference and then to sp6 no difference there either

 

Does anyone have an idea what could be wrong ?

I am going nuts here

 

Edited by: Knoton on Mar 14, 2011 11:58 AM

 

Edited by: Knoton on Mar 14, 2011 12:17 PM


Setting the sql statement

$
0
0

http://www.egbolig.dk/drift_bo_syd.rpt (HERE IS THE REPORT)

 

We are using SAP Crystal Report .NET Runtime files (http://scn.sap.com/docs/DOC-7824 newest version 13.0.9.1312) in our web asp.net application. Everything have been working fine, but we have can into problems when showing the certain kinda reports.

In our code get the reports sql statement using getSQLStatement.

Dim gp As New GroupPath() Dim sql As String = report.ReportClientDocument.RowsetController.GetSQLStatement(gp)

This will get the sql, and we use this sql (getSqlStatement) and attach a sql WHERE clause from the code to only get a certain number of records.

The report Drift_bo_syd.rpt has 5 tables, and the following sql statement. 

Database/Show Sql Statement

SELECT "rekvstam"."Sel", "rekvstam"."Afd", "rekvstam"."Levadresse", "rekvstam"."Rekvisition", "rekvstam"."Lejemaal", "rekvstam"."Lejer", "rekvstam"."Udfoertaf", "rekvstam"."Udfoertdato", "rekvstam"."Krit", "Selskab"."Adresse", "Selskab"."Postby", "Selskab"."Tlf", "Selskab"."Fax", "rekvstam"."Kontor", "rekvstam"."Hjemme", "rekvstam"."Rekvdato", "rekvstam"."Aftale", "rekvstam"."InitialRet", "rekvstam"."Arbejde", "kreditor"."Att", "rekvstam"."Konto", "Selskab"."Navn", "Selskab"."Email", "Interessentadresse"."Navn", "Interessentadresse"."Adresse", "Interessentadresse"."Postby", "Interessentadresse"."Email1", "Interessentadresse"."Telefon_Fax", "Interessentadresse"."Type", "Interessentadresse"."Tlf1", "rekvstam"."tlfLejer", "kreditor"."Kred", "Interessentadresse"."Interessentnr" FROM  (("Rekvstam" "rekvstam" INNER JOIN "Selskab" "Selskab" ON "rekvstam"."Sel"="Selskab"."Sel") LEFT OUTER JOIN "Kreditor" "kreditor" ON "rekvstam"."Kred"="kreditor"."Kred") INNER JOIN "Interessentadresse" "Interessentadresse" ON "kreditor"."Interessentnr"="Interessentadresse"."Interessentnr" WHERE  "Interessentadresse"."Type"='K' 

But if we run the report from our asp.net code, we get the following error: 

Cannot determine the queries necessary to get data for this report. Failed to retrieve data from the database. Error in File Drift_Bo_Syd {97FED382-1BAC-4DB1-970F-9E098ECE28F1}.rpt: Failed to retrieve data from the database.

 

After a long time searching for a solution, we found out that if we place the column kred from the kreditor table on the report, the report will work. (field explorer / database fields / kreditor (table) / kred (column)

 

Very important is that the field "kreditor.kred" is a primary key of the table kreditor, and also used in the linking.!

 

(We can get the report to work if we call the sql statement with the "kreditor"."kred" in the SELECT statement.

 

SELECT "kreditor"."kred", "rekvstam"."Sel", "rekvstam"."Afd", "rekvstam"."Levadresse", "rekvstam"."Rekvisition", "rekvstam"."Lejemaal", "rekvstam"."Lejer", "rekvstam"."Udfoertaf", "rekvstam"."Udfoertdato", "rekvstam"."Krit", "Selskab"."Adresse", "Selskab"."Postby", "Selskab"."Tlf", "Selskab"."Fax", "rekvstam"."Kontor", "rekvstam"."Hjemme", "rekvstam"."Rekvdato", "rekvstam"."Aftale", "rekvstam"."InitialRet", "rekvstam"."Arbejde", "kreditor"."Att", "rekvstam"."Konto", "Selskab"."Navn", "Selskab"."Email", "Interessentadresse"."Navn", "Interessentadresse"."Adresse", "Interessentadresse"."Postby", "Interessentadresse"."Email1", "Interessentadresse"."Telefon_Fax", "Interessentadresse"."Type", "Interessentadresse"."Tlf1", "rekvstam"."tlfLejer", "kreditor"."Kred", "Interessentadresse"."Interessentnr" FROM  (("Rekvstam" "rekvstam" INNER JOIN "Selskab" "Selskab" ON "rekvstam"."Sel"="Selskab"."Sel") LEFT OUTER JOIN "Kreditor" "kreditor" ON "rekvstam"."Kred"="kreditor"."Kred") INNER JOIN "Interessentadresse" "Interessentadresse" ON "kreditor"."Interessentnr"="Interessentadresse"."Interessentnr" WHERE  "Interessentadresse"."Type"='K'

 

But it should not be necessary to include this field (which is the primary key and used in linking the report) in the sql statement,
BECAUSE it is not used in the report. So maybe this is a bug?

 

It has not been necessary in RDC Crystal Report or RAS Crystal Report in a classic asp envoriment.

 

Here is the code we use to set the reports SQL Statement)

 

Try
Dim conn As New SqlConnection(connString)
conn.Open()
Dim sd As New SqlDataAdapter(New SqlCommand(nySQL, conn))
Dim ds As New Data.DataSet()

 


Dim navn As String = report.Database.Tables.Item(0).Name
sd.Fill(ds, navn)
report.SetDataSource(ds)
conn.Close()
Catch ex As Exception
Throw
End Try

CR 9.2 and Visual Studio 2003

$
0
0

Hello,

 

 

 

I created a report using Crystal Reports 9.2.2.693 and added it to my VS.net 2003 project. When I run the project from visual studio the report runs perfectly. However, when I deployed it to server (windows server 2003), the report runs but is displayed only on half page while other half to the right is empty. On the server I had installed CR runtime 9.2.3300 which is same as the version of the crystal report library reference added in VS2003. This is driving me crazy. Why is the formatting getting changed when deployed to server???

 

 

I have been at this for two days now. Don't know what to do?

 

 

 

Thanks

"The report filename was empty" rears its ugly head again

$
0
0

I know this is a common error people run into, but the previous threads I've found here haven't helped me discover the problem yet. I've got a web page using the CrystalReportViewer which has been working fine for several reports that have parameters where I'm allowing the viewer to provide the parameter prompts to the user.  My latest report has no parameters and I get this error on my first attempt to run the report.  However, if I then refresh the browser the report viewer displays the data correctly.  What's going on?  I saw on another thread where it was suggested that the code to load the report be moved from Page_Load to Page_Init, but I didn't see any behavioral differences with any of my reports when I tried that.  I'll post my code below.

 

        protected void Page_Load(object sender, EventArgs e)

        {

            if (!Page.IsPostBack)

            {

                this.crviewer1.ParameterFieldInfo.Clear();

 

                switch (Request.QueryString["rpt"])

                {

                    case "EmpUtilByWeek":

                        // Has parameters

                        ConfigureCrystalReports("~/Reports/EmpUtilByWeek.rpt", Global.MAS_ConnectionString);

                        break;

                    case "EmpUtilByMonth":

                        // Has parameters

                        ConfigureCrystalReports("~/Reports/EmpUtilByMonth.rpt", Global.MAS_ConnectionString);

                        break;

                    case "OTHoursCostRev":

                        // Has parameters

                        ConfigureCrystalReports("~/Reports/OTHoursCostRev.rpt", Global.MAS_ConnectionString);

                        break;

                    case "AROpenAging":

                        // No parameters

                        ConfigureCrystalReports("~/Reports/AROpenAging.rpt", Global.MAS_ConnectionString);

                        break;

                    default:

                        break;

                }

            }

        }

 

        private void ConfigureCrystalReports(string ReportFile, string ConnectionString)

        {

            // Set Crystal report source

            CrystalDecisions.Web.Report cr = new CrystalDecisions.Web.Report();

            cr.FileName = Server.MapPath(ReportFile);

            this.crsource1.Report = cr;

 

            // Get database logon info from web.config

            CrystalDecisions.Shared.TableLogOnInfo logon = GetReportLogonInfo(ConnectionString);

            this.crviewer1.LogOnInfo.Add(logon);

        }

 

        private CrystalDecisions.Shared.TableLogOnInfo GetReportLogonInfo(string ConnectionString)

        {

            CrystalDecisions.Shared.TableLogOnInfo logon = new CrystalDecisions.Shared.TableLogOnInfo();

            CrystalDecisions.Shared.ConnectionInfo connInfo = new CrystalDecisions.Shared.ConnectionInfo();

 

            string[] conn = ConnectionString.Split(';');

            foreach (string s in conn)

            {

                string[] keyVal = s.Split('=');

                switch (keyVal[0].ToLower())

                {

                    case "data source":

                        connInfo.ServerName = keyVal[1];

                        break;

                    case "initial catalog":

                        connInfo.DatabaseName = keyVal[1];

                        break;

                    case "user id":

                        connInfo.UserID = keyVal[1];

                        break;

                    case "password":

                        connInfo.Password = keyVal[1];

                        break;

                }

            }

 

            logon.ConnectionInfo = connInfo;

            return logon;

        }

 

OK, here's one thing I discovered... the statement this.crviewer1.ParameterFieldInfo.Clear(); seems to be the culprit.  When I comment this out, my parameter-free report displays fine on the first attempt.  However, the unwanted side-effect is that my other reports will retain their initial parameters if I try to run them a second time, which is the reason I used the Clear() method in the first place.  So, I then thought the fix would be to call Clear() only for my parameterized reports like this:

 

                if (this.crviewer1.ParameterFieldInfo.Count > 0)

                    this.crviewer1.ParameterFieldInfo.Clear();

 

But, alas, this once again makes my parameter-free report fail on the first attempt.  It appears that the act of evaluating the this.crviewer1.ParameterFieldInfo object is enough to cause this problem, which I find most peculiar.  So the only solution I've come up with is to move my Clear() statement into each of the case statements where I have a parameterized report.  This is a very non-elegant solution in my opinion, so I'd really like to understand why it behaves this way and hopefully find a better way to handle both parameterized and parameter-free reports.

How to dynamically load a Base64 string to an image on the Crystal Report?

$
0
0

I have a signature stored in my SQL Server 2008 DB as a Base64 encoded string. It is in a datatype of nvarchar(MAX), field named ="signature_stream"

 

I am using Crystal Reports Basic for Visual Studio 2008.a XML field definition file to load the data to the report.  In that file [signature_stream] is a xs:string type.  This is a asp.net application so ideally I would like not to have to save the image to disk before showing it.


I need to be able to take [signature_stream] and load it onto my report from server side code. 


Any help would greatly be appreciated.

Changing to a different report at run-time, in Ado.Net

$
0
0

BH
Hi, i'm using Visual Studio 2010 (c#) with Crystal Reports. I've used the instructions (Crystal Reports Guide To ADO.NET) for connection. However, i can't seem to figure out how to change the report.  For example: I have CrystalReport1.rpt connected to crystalReportViewer1. Now i want the user to be able to connect CrystalReport2.rpt.

 

Simply changing:

 

crystalReportViewer1.ReportSource = crReportDocument1;

 

to

 

crystalReportViewer1.ReportSource = crReportDocument2;

 

does not seem to work.  Do i need to somehow refresh it?

 

Thanks so much for your help.

Aron.

Viewing all 3636 articles
Browse latest View live


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