Quantcast
Channel: Crystal Reports
Viewing all 1507 articles
Browse latest View live

running Crystal Report from a dll

$
0
0

We have a Visual Studio C# project that contains some Crystal Reports, and is compiled as a DLL.  I want to run those reports for debugging purposes.

I've set up another project that references the DLL, and created an *.aspx page to call the report but I keep getting parser error messages, because it won't recognise the CodeFile/CodeBehind from another project. I'm not getting anywhere on google, can someone point me in the right direction?  Does anyone know of a tutorial somewhere that explains how this is done, step by step?

Thanks.


JS Issue on CrystalReports for Visual Studio 2010

$
0
0

Hi everyone,

I'm making a solution with Visual Studio 2010 using "cr4vs2010". When I start my web app from Visual Studio and I open my report, There is any problem, but if I want to export this file to a .pdf file or to other format, I receive a JS error message:

"Object required" and the debugger marks the following line:

bobj.crv.stateManager.setComponentState('CRV1__UI',eval('('+document.getElementById('__CRYSTALSTATECRV1').value+')'));

Sometimes in previous versions of CrystalReports I only copy the "aspnet_client" folder in the application root and it works, but in this version of Crystal Reports this folder does not exists.

I have several days stucked with this issue, please I need some help.

Sorry for my bad english, thanks in advance!


Lawrence

Runtime upgraded to higher version; bitmap property not supported

$
0
0

Crystal report runtime (version 13.0.0.99) is installed on the development machine (Window 10, 64-Bit). The following code displays a log-on report:

string sPath="D:\Image\company_logo.gif"CrystalDecision.CrystalReports.ViewerObjectModel.BlobFileObjectInstance bimg=(CrystalDecisions.CrystalReports.ViewerObjectModel.BlobFieldObjectInstance)if(bimg !=null&&System.IO.File.Exists(sPath)){//Set company_logo.gif on IBlobFieldObject placed of Crystal Report
  bimg.bitmap =(System.Drawing.Bitmap)System.Drawing.Bitmap.FromFile(sPath);}

Same is working fine on machines where SAP Crystal Report Runtime engine (version 13.0.0.99) installed.

We upgraded the SAP Crystal Report Runtime engine to version 13.0.18.2192, causing this error:

Error 5 'CrystalDecisions.CrystalReports.ViewerObjectModel.BlobFieldObjectInstance' does not contain a definition for 'bitmap' and no extension method 'bitmap' accepting a first argument of type 'CrystalDecision.CrystalReports.ViewerObjectModel.BlobFieldObjectInstance' could be found (are you missing a using directive or an assembly reference?)

To resolve this we use bitmapStream instead of bitmap which works fine post-upgrade:

CrystalDecisions.CrystalReports.ViewerObjectModel.BlogFieldObjectInstance bimg =(CrystalDecisions.CrystalReports.ViewerObjectModel.BlobFieldObjectInstance)if(bimg !=null&&System.IO.File.Exists(sPath)){//Set company_logo.gif on IBlobFieldObject placed of Crystal Report
  bimg.bitmapStream =newMemoryStream(ConvertTobyteArray((System.Drawing.Bitmap)System.Drawing.Bitmap.FromFile(sPath)));}publicbyte[]ConvertTobyteArray(Bitmap value){byte[] bitmapbytes =newbyte[5000];MemoryStream stream;

  using ( stream =newMemoryStream()){
    value.Save(stream, value.RawFormate);
    bitmapbytes = stream.ToArray();}

 stream.Dispose();return bitmapbytes;}

But the same code on machine with Crystal Report Runtime (version 13.0.0.99) gets this error:

Error 5 'CrystalDecisions.CrystalReports.ViewerObjectModel.BlobFieldObjectInstance' does not contain a definition for 'bitmapstream' and no extension method 'bitmapstream' accepting first argument of type 'CrystalDecisions.CrystalReports.ViewerObjectModel.BlobFieldObjectInstance' could be found (are you missing a using directive or an assembly reference?)

If the Crystal Report runtime is upgraded to a newer version, why is the bitmap property no longer supported? How can we display an image a report for either version?

Crystal Report linking issue

$
0
0

I have been working on a Crystal Report for my company and every time I run the report, I get ZERO information back.  I am fairly new to Crystal Reports and very rusty on SQL commands, but I figure I will post the SQL Code here and the report and you can at least look at the SQL Code and see if I am doing something wrong.

SELECT
A.AR_CASH_ID ID,
A.CLIENT_ID,
C.NAME CLIENT_NAME,
A.CHK_DATE,
A.CHK_NUMBER,
A.CHK_AMT,
A.CHK_MEMO,
A.TX_TYPE,
A.DEPOSIT_TO,
A.SOURCE_AUDIT,
G.DESCRIPTION GL_DESC,
G.GL_CURRENCY,
I.CASH_MISC
FROM
AR_CASH A
INNER JOIN CRYSTAL_ARRCU I ON I.ID = A.AR_CASH_ID
INNER JOIN CRYSTAL_PROG P ON P.PROG_ID = I.PROG_ID
LEFT OUTER JOIN GLACCOUNT_ALL G ON G.GL_ACCT_ID = A.DEPOSIT_TO
LEFT OUTER JOIN CLIENT_ALL C ON C.CLIENT_ID = A.CLIENT_ID
WHERE
'CASH' = I.CASH_MISC AND
P.PROG_USER = '{?PROG_USER}' AND
P.PROG_NAME = '{?PROG_NAME}'
UNION ALL
SELECT
A.AR_MISC_ID ID,
A.CUSTOMER_NAME CLIENT_ID,
A.CUSTOMER_NAME CLIENT_NAME,
A.CHK_DATE,
A.CHK_NUMBER,
A.CHK_AMT,
A.CHK_MEMO,
A.TX_TYPE,
A.DEPOSIT_TO,
A.SOURCE_AUDIT,
G.DESCRIPTION GL_DESC,
G.GL_CURRENCY,
I.CASH_MISC
FROM
AR_MISC A
INNER JOIN CRYSTAL_ARRCU I ON I.ID = A.AR_MISC_ID
INNER JOIN CRYSTAL_PROG P ON P.PROG_ID = I.PROG_ID
LEFT OUTER JOIN GLACCOUNT_ALL G ON G.GL_ACCT_ID = A.DEPOSIT_TO
WHERE
'MISC' = I.CASH_MISC AND
P.PROG_USER = '{?PROG_USER}' AND
P.PROG_NAME = '{?PROG_NAME}'

I am basically canning an old report as to avoid making a new report from scratch, but needless to say I am stuck.  If anybody has any advice as to how to run this please let me know.

Question About Counting

$
0
0

Still learning crystal reporting but have a question:

I have three columns of data. Author 1, Author 2 and Author 3. A workers name will be in any of these columns for multiple entries. How would I go about counting them and having a report at the end. I do not have a database of names to compare them to. The data would look like. Any help would be great as I need a kick in the right direction. Thank you!

Item     Author 1     Author 2     Author 3   
1        Bob          Tom          Larry  
2        Larry        Tom          Bob

I would need a report that spits out:

Name    Total  
Bob     2  
Tom     2  
Larry   2 

What technique can be used for printing ALL PAGES from crystal report?

$
0
0

I'm a beginner in asp and vb.

I have been researching and experimenting a few methods for this one week, none worked, most of the methods will only print one page (current page) in the crystal report.

Meanwhile, the default print button in the crystal report viewer has only the export option, in the pop menu that comes out when the button is clicked.

I want to have an external button in which when its clicked it opens the print preview page, displaying all pages of the report from the crystal report viewer, where the user can select the printer, adjust whatever settings, and choose the pages to be print.

IS THIS EVEN POSSIBLE? please help.

Thank you.

Crystal Reports First Project

$
0
0

Am new to Crystal Reports/Asp.Net and need some help getting started.

I have my Data on SQL Server, have created a DataSet.

Have also created a sample.rpt using data from my DataSet.

Am able to see my report and my data on "Main Report Preview"

Have created a SAMPLE.ASPX page and added the CrystalReportsViewer bound to sample.rpt andam able to see my report on the SAMPLE.ASPX form in Design mode.

When I try to run the program I get a blank sample.aspx form displayed in browser.

I did add CrystalReportViewer1.DataBind() in the codebehind page_load event.

Im stuck at this point - what am I missing?

Help is appreciated.

Lee

Here's my aspx form designer code..

<body><form id="form1" runat="server"><CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" 
            AutoDataBind="True" 
            Height="1202px" ReportSourceID="CrystalReportSource1" 
            ToolPanelWidth="200px" Width="1104px" /><br /><div><CR:CrystalReportSource ID="CrystalReportSource1" runat="server"><Report FileName="Sample.rpt"> </Report></CR:CrystalReportSource></div></form></body>

Crystal report access from Newtork folder

$
0
0

Hi Guys,

I'm looking for a solution to run my crystal reports File is placed in network folder And I have to call the report and populate in ASP .net,C# Crystal reportviewer. 

Please share the link,Ideas to achieve.

Thanks


How to Dynamically Switch Databases

$
0
0

Am using ASP.Net.

When I login to my program I dynamically assign a connection string to all of my SQL Database Accesses based upon the user who logs in.

Connection string is part of the users profile.

User Login "A" has a connection string pointing to a dataset on Server "A" and User Login "B" has a connection string pointing to a identical dataset schema on Server "B"

How do I apply a dynamic connection string to the reports I've written using Crystal Reports so User "A" reports his data and Use "B" reports a different set of data?

When I created my ASP.Net (VB) project I use the Add Sql Server Tool.  I then created my Crystal Reports using the Wizard.

So, in vb code how do I dynamically assign my reports to a connection string?

Lee

Possible to display HTML with Crystal Reports?

$
0
0

I'm new to Crystal Reports and I'm wondering if it can print/display html.

I have a column in my database that holds the HTML, and I want the data in this column to be in the detail of the report keeping the HTML format.

So far, I've got the IFieldObject for the column dragged onto the report, and set the "TextFormat" option to "crHTMLText".  I've also right-clicked the object, went to the paragraph tab, and set the "Text Interpretation" option to "HTML Text".

But when I preview the report, it looks like it is actually stripping out the HTML.  It does apply simple HTML formatting for things like bolding, italicizing, and underlining.  But HTML tables and bulleted lists lose all their formatting.

What's going on?  Can I not do this?

When I click to navigate to the next page i get "Please wait while the document is being processed"

$
0
0

I am creating a report in a ASP.NET application. I have some bills created, and when I click on a next page, it shows me Please wait while the document is being processed" message. How can I fix this?

This is my code for creating the report:

protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                bool isValid = true;


                string repName = HttpContext.Current.Session["repName"].ToString();
                int zgradaID = (int)HttpContext.Current.Session["id_zgrade"];
                int mesec = (int)HttpContext.Current.Session["mesec"];
                int godina = (int)HttpContext.Current.Session["godina"];


                if (string.IsNullOrEmpty(repName))
                    isValid = false;


                if (isValid)
                {


                    ReportDocument rd = new ReportDocument();
                    string repPath = Server.MapPath("~/Izvestaji/") + repName;


                    rd.Load(repPath);


                    Izvestaji.IzvestajiRep irep = new Izvestaji.IzvestajiRep();
                   
                    rd.SetDataSource(irep.StampanjeRacunaDS(zgradaID,mesec,godina));


                   


                    this.CrystalReportViewer1.ReuseParameterValuesOnRefresh = true;
                    CrystalReportViewer1.ReportSource = rd;




                    Session["repName"] = "";
                    Session["id_zgrade"] = "";
                    Session["mesec"] = "";
                    Session["godina"] = "";




                }
                else
                {
                    Response.Write("<h2>Izvestaj nije pronadjen!</h2>");
                }


            }
            catch (Exception ex)
            {


                Response.Write(ex.ToString());
            }
        }

Crystal report Object reference not set to an instance of an object on Visual Studio 2012 ASP.net

$
0
0

Creating new report file does not solve the problem.  I have to exclude the report from project so that the program will run.

Please help.

why when i declare group variable in rdlc report.group variable is not showing in expression tab

$
0
0

how to make a group according to given date wise in rdlc report. and then sum first group values with second group values and its repeat untill the last given date

i want in below format 

thank you 

DateReceiptsPaymentDescription
1-6-20175000200first branch
1-6-20174000500Second branch
1-6-20175000200third branch
SUm of 1-6-201714000900
Closing on 1-6-20171400 -900=500
2-6-2017600200first transaction
2-6-2017800200second transcation
sum of 2-6-20171400400
Closing on 2-6-2017500 +1400-400=1500

field in suppressed section

$
0
0

Good morning
In a report I made a formula in a section in the suppress section button with
a condition that checks that a text field is empty, if it is empty suppresses the selection.
In this section there is another field with a value that is the hours needed to do a job
This field Hours I have to make a sum with other fields if the section is not suppressed, but the field is always added
and I do not understand how I can do it.
Please can someone give me some advice?
Thanks so much
Fabrizio

this is the formula to suppress the section

IF {tblSchedaCompletaPerStampa.LavorazioneBBG} = "" THEN
  TRUE
Else
  FALSE

And  this is the formula to add the fields if they are visible

If {tblSchedaCompletaPerStampa.NoteVerniciatura} = "" Then
ROUND({@TempoFresaPerNumPezzi}/10)+{tblTempi.TempoGiorniTrattamento} 
Else If {tblSchedaCompletaPerStampa.Trattamento} = "" Then
ROUND({@TempoFresaPerNumPezzi}/10)+{tblTempi.TempoGiorniVerniciatura}
Else If ({tblSchedaCompletaPerStampa.NoteVerniciatura} = "") AND ({tblSchedaCompletaPerStampa.Trattamento} = "") Then
ROUND({@TempoFresaPerNumPezzi}/10)
Else
ROUND({@TempoFresaPerNumPezzi}/10,0)+{tblTempi.TempoGiorniTrattamento}+{tblTempi.TempoGiorniVerniciatura}

I hope you understand what I want to say

Thanks a lot

Fabrizio

How to keep report data source for one report? When I open another, and then come back to the first and export it, the data from the second is saved

$
0
0

I have some Crystal Reports that I am using with my ASP .NET MVC application. I am using Session to get the data from the MVC controller to the WebForm.

My problem is that if I open report with one parameter values in one tab, and after that open it with different values, when I come back to the first one and export it, I get the values from the second.

I know that is happening because when I generate the second one, my session variable has that values. But why does not my tab keep the parameter values when that tab in chrome losts focus? Why it refreshes the data source for the report?

This is my MVC controller:

 [HttpPost]
        public void iPregledStanaraPoZgradi(int idZgrade)
        {
            iRep = new Izvestaji.IzvestajiRep();
            this.HttpContext.Session["repName"] = "CrystalReportPregledStanara.rpt";
            this.HttpContext.Session["id_zgradePregledStanaraPoZgradi"] = idZgrade;


        }

This is my WebForm code for generating the report:

 public void createRep()
        {
            try
            {

                bool isValid = true;

                string repName = HttpContext.Current.Session["repName"].ToString();

                int zgradaID = (int)HttpContext.Current.Session["id_zgradePregledStanaraPoZgradi"];

                if (string.IsNullOrEmpty(repName))
                    isValid = false;

                if (isValid)
                {
                    int zid = zgradaID;


                    ReportDocument rd = new ReportDocument();
                    string repPath = Server.MapPath("~/Izvestaji/") + repName;

                    rd.Load(repPath);

                    Izvestaji.IzvestajiRep irep = new Izvestaji.IzvestajiRep();
                    rd.SetDataSource(irep.PregledPoStanaruDS(zgradaID));

                    CrystalReportViewer1.ReportSource = rd;
                    this.CrystalReportViewer1.ReuseParameterValuesOnRefresh = true;


              
                }
                else
                {
                    Response.Write("<h2>Izvestaj nije pronadjen!</h2>");
                }

            }
            catch (Exception ex)
            {

                Response.Write(ex.ToString());
            }
        }


Conflict between Crystal Reports and SSRS in Web Application

$
0
0

I'm using crystal reports with my .NET web application with sql server database. Later I installed Reporting Services. Now, when I go to pages which consists of crystal reports in my web application, it is navigating to Reporting services portal. 

Can you guide in displaying the crystal report instead of navigating to Reporting Services

Crystal Reports using Dataset in C#

$
0
0

 using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;

public partial class Default4 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        SqlConnection sqlConn = new SqlConnection("Server=ServerName;Initial Catalog=DatabaseName;User ID=UserName;Password=Password;");


        SqlCommand comd = new SqlCommand();
                
        comd.CommandText = "SELECT * From TableName";
        comd.CommandType = CommandType.Text;
        comd.Connection = sqlConn;
        comd.Connection.Open();

        SqlDataAdapter sqlAdapter = new SqlDataAdapter();
        sqlAdapter.SelectCommand = comd;

        DataSet ds = new DataSet();
        sqlAdapter.Fill(ds, "TableName");
       
        ReportDocument myReportDocument;
        myReportDocument = new ReportDocument();
        
        myReportDocument.Load(Server.MapPath("CrystalReport.rpt"));
        myReportDocument.SetDataSource(ds);
        comd.Connection.Close();
        
        CrystalReportViewer1.ReportSource = myReportDocument;
      
        CrystalReportViewer1.DataBind();

      

    
     
    }
}

 

I thought i would post this for the reason i spent a couple of days myself looking for something i felt was solid enough to work for me.  This is done by creating a DataSet and a crystal report supplied by the dataset.

 

You can easily use this to work with parameters carried over from web page to web page as well as parameters and events such as button click events within the existing page. 

 Modify this line of code : comd.CommandText = "SELECT * From TableName";   and change it to something like this:

 

 MyEmployeeName = Textbox1.text      // then add a button click event to do your work

  comd.CommandText = "SELECT * From TableName Where EmployeeName =" + MyEmployeeName;

or many other parameters that would work for you.

 

Some might think this is trivial but it does and has worked perfectly for me.  Just felt worth while to post.

 

JohnnyBS

Crystal Report not working after upgrade Dot Net framework 3.5 to 4.5.2

$
0
0

Hi,

Crystal Report not working after upgrade Dot Net framework 3.5 to 4.5.2  in my Website Server: Window 2012 and Database: SQL 2008 R2

Please Help how to configure Crystal Report in Dot Net framework  4.5.2 

Below Error accruing after export report in  pdf :

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

When I open crystal reports in a different tabs they all share the same data source. How can I change that?

$
0
0

I have a C# ASP .NET MVC application that uses Crystal reports.

My problem is that when I open for an example two reports in two different tabs, my report data source is bound to the last one opened. So, if I open the first report in one tab, and after that the second, when I try to save the first report, or refresh it, it will use the data source from the second(last one opened). I don't know how to change my code to make it work.

This is my code for creating the report:

public void createRep()
        {
            try
            {

                bool isValid = true;
                
                string repName = HttpContext.Current.Session["repName"].ToString();

                
                int zgradaID = (int)HttpContext.Current.Session["id_zgradePregledStanaraPoZgradi"];

                if (string.IsNullOrEmpty(repName))
                    isValid = false;

                if (isValid)
                {
                    int zid = zgradaID;


                    ReportDocument rd = new ReportDocument();
                    string repPath = Server.MapPath("~/Izvestaji/") + repName;

                    rd.Load(repPath);

                    Izvestaji.IzvestajiRep irep = new Izvestaji.IzvestajiRep();
                    
                    rd.SetDataSource(irep.PregledPoStanaruDS(zgradaID));
                    
                    CrystalReportViewer1.ReportSource = rd;
                    this.CrystalReportViewer1.ReuseParameterValuesOnRefresh = true;


                    

                }
                else
                {
                    Response.Write("<h2>Izvestaj nije pronadjen!</h2>");
                }

            }
            catch (Exception ex)
            {

                Response.Write(ex.ToString());
            }
        }

Error 1904...failed to register error message during Crystal Reports Run-time installation

$
0
0

I am using Visual studio 2017 & Crystal report 13_0_22   in my development internment. It works fine in development environment. 

When i try to install Crystal Reports Run-time in windows 7 for client deployment i am getting error 1904...failed to register dll

please advice on this.

Viewing all 1507 articles
Browse latest View live


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