Change the displayed row in crystal reports c# - c#

I have to print a report of a clients details using my c# program. I use a access database to store the client details. I've successfully created and displayed the report on my form in my c# application. Now I'm struggling to change the displayed row for the report. The report automatically chooses the first row in my database. I've created the crystal report without coding, I used the crystal reports visual studio plugin therefore can't paste any code.

Related

How to open a report viewed in report viewer in excel without saving it first in VS2010 C#

I am building an application in c# using Visual studio 2010 with access database. I am using reportviewer of visual studio to view the reports which is working fine for me.
It has option to export your report in excel, PDF or word which needs to be saved first and then could be opened. But I want to open that report in excel without having to save it first.
I don't know if it is possible or not if it is kindly show me how? I will paste some pictures how it works
Here in the first step you will have to click on the export into one of the three
Then you would need to save the report
After saving, you can than open the report in excel, PDF or word but I would like to skip the second step of saving it and directly open it in excel.
You can handle ReportExport event of ReportViewer and set e.Cancel=true; then using Render method of its LocalReport or ServerReport property, export it to desired location.
ReportViewer - Export report programmatically to a specific location without showing save dialog
save the file in TempFolder ... after it saved , you can open it directly:
System.Diagnostics.Process.Start(#"YOUR_PATH");

How can I set crystal report data source a database that's not connected to it?

Iam working on windows app using c# and using crystal report. My problem is that I need to configure my report to get data from the live database but I can't connect to it while developing the program.
Is there a way that I can configure crystal report with live database and connect when generate the exe and install it on the same network with live database?
I know of a way to do this in Visual Studio, but if you are using one of the stand-alone SAP clients to develop the report this method won't help you.
In Visual Studio you want to add a DataSet to your project. Don't implement this through code though, do this by adding a DataSet object to your project in the project explorer just like you would add a new class file. Within this DataSet object you can create a DataTable with all of the same columns you will have in the database you plan to use.
This will allow you to design a crystal report using the dataTable within your DataSet as the database. You won't be able to preview anything in the Crystal Report Designer though.
In your Visual Studio project you will need to build a dataset that has the same schema as the dataset and datatable you have defined as the database for your report. Then you can assign the datatable within your dataset to the DataSource property of your crystal report at runtime.
I've mostly used this approach when consuming CSV data files as datasources for crystal reports in a system that had a terrible reporting system that could only produce text file outputs, but it could be used almost identically for what you are trying to accomplish, but instead of importing a CSV file, you will query your database at runtime time to get the data into a dataset that is assigned to DataSource property of the report.

Display only 10 records per page in RDLC report

I have followed all instructions given on below link:
How do I limit the number of rows in a table while designing a rdlc report?
But it display only one record per page.Can anybody help to come out of this.
http://www.sqlchick.com/entries/2010/9/11/displaying-fixed-number-of-rows-per-ssrs-report-page.html
i have used this and it is working as expected.
are you using RDLC report viewer in standalone mode or you are using report viewer with report server integrated mode?

Microsoft Report Viewer Showing hidden columns on exporting to excel

I'm using Microsoft Report Viewer in an ASP.Net application on the 4.0 framework. I have the report showing fine inside the webpage, but I was recently requested to hide several columns. I found out that through editing the Column Visibility by right clicking on the column in the .RLDC file would allow me to hide it, but I need to be able to show the hidden columns upon Exporting to Excel. As far as I can tell Microsoft Report Viewer exports exactly what it has shown to Excel.
Does anyone know how to access or change the columns properties upon the export to excel click event on Microsoft Report Viewer 2010?
Your best bet is to add your own export functionality.
Set ShowExportButton="False" in the ReportViewer and add a new button in your page that hides the columns and then exports the report to excel.

Can Crystal Reports be edited in a .Net Windows interface?

I am currently evaluating Crystal Reports 2008 for use within a major enterprise project. I have successfully used Crystal Reports Basic within Visual Studio, but we want more functionality. Can these reports be edited in a .Net Windows interface?
Reports will be produced based on ADO.NET Xml datasets and will be saved to a SQL Server db as blobs of the rpt files. We will be retrieving these rpt files for viewing within a .Net Windows application coded using Visual Studio 2008 in C#.
I need to produce letters that hide and show sections/paragraphs based on formulae, but the users want to be able to edit the text.
Once a report has been created and is being displayed within the .Net CrystalReportViewer control (inside a .Net Windows application), is there any way I could permit the user to alter the displayed text and re-save the rpt file?
I know that I can use parameters, but it's not ideal for large paragraphs of text which may include some words in bold for example. The users are only likely to be changing a few words, such as the addressee of the letter. They have insisted that they need to be able to change anything on the letter.
I also know that (with Crystal XI or 2008) I can export to EditableRTF which does not put the text in frames like the standard RichTextFormat export option. The .Net RichTextBox component does not show headers or footers, which is a pain. I can show the RTFs in Word (even though they miss out lines and boxes from the report, but that's another matter) but quite frankly I'm terrified of the stories of deploying Office interop components in .Net apps.
When Crystal displays a report in preview mode you can click on pararaphs and it knows that there is a 'field' there because it highlights the row(s) with a box. Is there any way we can just edit this text and save the report again?
I'm under pressure to produce an estimate for this area of work. Is it possible within Crystal?
You've got a really good handle on the capabilities of Crystal, and you're right - the idea of editing big chunks of report text "live" is going to be tough.
The "export to RTF" option might be workable, provided you can live with one-way generation (after you use Crystal to generate the report and start editing the output, you can't re-generate without losing your edits).
Have you considered something like OneNote or other XSLT-based solutions? It seems like your users want a lot of control over the generated output, so your design's going to have to factor that in. Maybe even generate output and then shoot it straight into a document management system so users' changes are tracked and controlled?

Categories

Resources