.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Crystal Report with DataSet, DataTable (Having Problems)

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :ASP.Net
Hello All,     I am a bit new with Crystal Reporting and I was given the Job to take an exisitng report , modify it and load it on a website... the report part is done but the loading is been a pain. So here is what i did,    protected void Button1_Click(object sender, EventArgs e) { SqlConnection cn = new SqlConnection("server=ss;uid=sss;pwd=ss;database=sss"); cn.Open(); #region quer //Query Here, This is working fine #endregion ReplaceEscape(qry); SqlCommand cmd = new SqlCommand(qry, cn); cmd.CommandTimeout = 1000; cmd.ExecuteNonQuery(); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet myDataSet = new DataSet(); da.Fill(myDataSet, "DSAllStatQuery"); ReportDocument cryRpt = new ReportDocument(); cryRpt.SetDataSource(myDataSet); cryRpt.Load(@"C:\Users\erodriguez\Documents\Visual Studio 2010\WebSites\AllStats\CrystalReport.rpt"); CrystalReportViewer1.ReportSource = cryRpt; cn.Close(); } public static string ReplaceEscape(string str) { str = str.Replace("'", "''"); return str; } I crea

View Complete Post

More Related Resource Links

Crystal report with dataset and list - please help


Hi Guys;

i'm new in reporting so thanks to be patient with me,

here is my problem, i have created a report then a report viewer,, i passed some parameters to the report it goes well.

i'm working with local data stored in List<object>, i tried to fill my dataset (data) with those local data stored in the list, i filed Cry

looking for yor help


Include a Crystal Report in .NET Web Service for Dynamic In-Memory-Only DataSet



I would like to use Crystal Reports in a .NET web service.  Ultimately I would like to convert my report document to a PDF and then return the PDF as a byte array. 

My .NET DataSet is generated dynamically at run-time.  It consists of four related tables.  Since my DataSet does not have a physical datasource, I created an XML Schema file.  I then added the XML Schema file to the web service project with Add Existing Item. 

A solution for working with a dynamic in-memory DataSet exists for ASP.NET web sites and client-based forms.  I tried to use this method as it is published.  When that didn't work I tried creating the report and XML Schema directly in the web service project, but that also didn't work.


The problem is apparent when you try to set the datasource.......the code bombs on the call to SetDataSource(DataSet) with the message
ex = {"The data source object is invalid."}

Crystal Reports would save me a lot

how to connect anot sql dataset to crystal report

hello i have adynamic dataset wuch i create and not from sql or access table i have acrystalreport and i want to connect the report to the dataset   tnx Adnan Mahajna 

dynamic Dataset-Crystal Report

Hello everybody, i'm developing a C# application in which i'm using crystal reports to display data from database. i'm trying to create a dynamic dataset since it's going to be filled from multiple classes i'm not able to fill these dataset unless i add to my sql query the "column AS columName" for example:"select nmClient as Name from customer " ; if i write down "select nmClient  from customer", it won't work   please let me know if there any ulternative solution in order to solve my problem   thank you in advance  

Printing crystal report from webservice



I am trying to print crystal repot directly from a C# application, which is calling webservice. I am able to display report in crystalreportviewer by passing the webservice call to datasource. However, is there anyway, I can print directly without showing the report?

Alternatively, I was trying return ReportDocument object from webservice, which would solve my problem, but I was unable to return the ReportDocument because of serialization issue. Is it even possible? Thank you


Crystal Report Asking for Database Authentication each time when I view Page.


Whenever I open my Crystal Report page, I am taken to the Database Authentication page where I am asked for

User name
Data Name

each time.

Is there a way to avoid this and I save these authentication in my page once.

I am using VS2005, C#.

Any Help will be appriciated.


Error Message when trying to open crystal report


Logon failed. Details: 42000:[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open database "DATA" requested by the login. The login failed. Error in File C:\Windows\TEMP\NewQuote {573CE511-64B7-4161-B9DF-0E58EB1EDA19}.rpt: Unable to connect: incorrect log on parameters.

I get the above message when loading the crystal report from the Intranet via IIS but it works fine from the localhost the report loads ok and picks up my parameters.  This is my Code behind Page.

Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load

        Dim Count As Int32
        Count = Int32.Parse(Label1.Text)

        Dim ConnInfo As New ConnectionInfo
        With ConnInfo
            .ServerName = "\\Server1\Sqlexpress"
            .DatabaseName = "DATA"
            .UserID = "sa"
            .Password = "1181

How to display related tables in one crystal report and how to link this report with combobox?


Hi! I want to display a crystal report in my vb.net application. Suppose I have tables named student details, student marks, student address, etc... Now if I want to display all these details (fields of all tables) in one crystal report (with page breaks if necessary) then how will I achieve it. I will be providing a combo box in my application that contains list of student names. How can I link this combo box with the cystal report to dynamically display report for different student on selected index change of combo box? Help me friends. An example would be appreciable.

Crystal Report parameter value window.


 Hi friends,

   I am using Crystal report which displays the result of stroed procedure which have 2 paramater.

  When i run report it shows two window for getting each parameter.

  My need is, can i have one window for getting all the paramter value for stored procedure.


  With Advanced thanks,






Crystal Report gives System.AccessViolationException: Attempted to read or write protected memory. T


when a crystal report for same id is opened again at same time or refreshed then it gives the

"System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

Stack Trace is :-

Stack Trace:

[AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.SetConnectionInfos(ConnectionInfos ConnectionInfos) +0
CrystalDecisions.CrystalReports.Engine.Table.ApplyLogOnInfo(TableLogOnInfo logonInfo) +362
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetTableLogon(Tables tables, String user, String password, String server, String database, Boolean ignoreCase) +258
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDatabaseLogon(String user, String password, String server, String database, Boolean ignoreCase) +204

Crystal Report vs 2003 convert to vs 2008 parameter problem


Hi friend,

I have a project develop with Visual Studio 2003, when i convert the project to Visual Studio 2005 is work well. But when i convert to Visual Studio 2008, the crystal report when have pass parameter will prompt the parameter field to re-type then show the report.

But in this converted project i create a new report and pass the parameter is ok. That means i wan re-do all report @.@??

Does someone can help me solve this problem??

Thank you

Crystal report


Hi frnds,

              How to use crystal report in asp.net 3.5 using C#?.....

crystal report -visual studio 2008 dual axis chart (bar & line)


dear all, 

i use crystal report integrated with  vs.2008, and i want to make chart with dual axis (bar & line).

i have used bar chart and input the data with 2 values..

then in chart options > template, i activated the dual axis..

my question is, how i can change the 2nd value with line chart not bar chart??

i'd tried to find the right settings in "chart options" but still can't find the solution.

for information in "chart options" there are 4 sub menu : template, general,titles,grid..

i read in a tutorial there's more sub menu called "series" in crystal report (stand alone version)..

is it possible doing it in Crystal Report VS. 2008?

please,, i need your advice and solution..

Thanx before..


Showing filtered Records in Crystal Report as per User Requirement


ReportDocument reportDocument = new ReportDocument();
    ParameterField paramField = new ParameterField();
    ParameterFields paramFields = new ParameterFields();
    ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
    protected void Page_Load(object sender, EventArgs e)
        if (!IsPostBack)
            paramField.Name = "@Ext";
            //*Remember to reconstruct the paramDiscreteValue and paramField objects
            paramDiscreteValue.Value = 44854
            CrystalReportViewer1.ParameterFieldInfo = paramFields;

page postback problem with crystal report


Hi , i am creating crystal report with asp.net it is working showing data but  data is of two page its is take round trip action but report is not show 
until again i click on show button in this it is not propersly showing that data is how.

<br />
    <asp:Button ID="btnShow" runat="server" OnClick="btnShow_Click" Text="Show Report" />
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" DisplayGroupTree="False" EnableDatabaseLogonPrompt="False" /> CrystalReportViewer1.ReportSource = null; SqlCommand cmd = new SqlCommand(strcmd, c.con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); ReportDocument doc = new ReportDocument(); doc.Load(AppDomain.CurrentDomain.BaseDirectory + "\\rptQuotation.rpt"); doc.SetDataSource(ds.Tables[0]); // login info SqlConnectionStringBuilder csb = new SqlConnectionStringBuilder(ConfigurationManager.ConnectionStrings["conStr"].ConnectionString); TableLogOnInfos crtableLogoninfos = new TableLogOnInfos(); TableLogOnInfo crtableLogoninfo = new Tabl

print of crystal report


hi all

my crystal report works well but when  i want press button print instead of print ,export it to a file

what should i do for paper print?

thanks in advance  

Data Points: DataSet and DataTable in ADO.NET 2.0


ADO. NET 2. 0 sports some exciting enhancements to the core classes found in ADO. NET 1. x and introduces a variety of new classes, all of which promise to improve performance, flexibility, and efficiency.

John Papa

MSDN Magazine November 2005

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend