Crystal Reports Excel export with worksheets - crystal-reports

Is there a way to convince Crystal Reports to export a page / group / whatever to separate worksheets when exporting to Excel (Data Only)? I'm using the CR that came with VS2008 (version 10.5)
Thanks.

According to the documentation you cannot export a report directly to multiple worksheets in a single Excel workbook.
When the limit of 65536 rows in Excel is reached though, the exporter does create a new worksheet, but you are not in control :)
update
To create your own Excel merger:
PRE: Make sure you have the Office (Excel) SDK libraries installed.
PRE: Place the files that need to be merged in a single directory.
In a VS2008 solution:
Create a new empty Excel Workbook (variable: objNewWorkbook)
Loop through the files in the directory (where you placed the Excel files) and for each item:
Load the file as a Excel Workbook (variable: objWorkbookLoop)
Create a new Worksheet in objNewWorkbook (optionally: with the filename of objWorkbookLoop) (variable: objNewWorksheetLoop)
Copy the data from (probably sheet1 in) objWorkbookLoop to objNewWorksheetLoop
Finally save objNewWorkbook to a file.

One of the things everybody ignores is that excel automation is not an acceptable solution. Yes it works ( almost always) , but even Microsoft recommends to not use it for unattended execution : http://support.microsoft.com/kb/257757
The only safe way I know to export a crystal report to multiple worksheets is by creating a grouped report and burst it using R-Tag report manager. This tool is not using Excel automation so you can run your reports at any time and on the server but if you are currently using another software to run your reports you will need to switch to this one (it is not an extension).
I know this thread is an old one, but I can see links to it without a real answer. Hopefully this will help somebody.

Related

Crystal Reports: export datasource with report definition

I am stepping into a new reporting environment and I don't have a lot of background info yet. But my company utilizes a series of crystal reports.
I want to compare two reports that are identical except that they connect to different data sources. I can click on both reports in the Crystal Reports viewer, go to Database > Set Database Location and I am able to see the data source. If I do this for both reports in question, I can see that they both connect to different data sources, as expected.
However, when I export the two Crystal Reports as text files and then compare them using Notepad++, I don't see the datasource / connection string in the report files, so when I do a compare, they are exactly the same.
If the exported text files are exactly the same, how does Crystal Reports Viewer know to point one report towards a prod data source and another report towards the dev data source? It does not appear to be embedded in the exported metadata / report definition file.
Thank you!!
The connection info is simply not part of the exported report definition text.
But, obviously, it is part of the report definition.
If you need to export more detailed report definition information, including connection properties, consider getting a documentation utility. Ken Hamady maintains a list of those here.

How to output 2 excel files from a single crystal report rpt file

The requirement is that for a given set of date parameters I want to to output a premium and a tax excel separately. Currently i have 2 separate rpt files to generate the premium file and tax file. I am thinking to merge both of them and run 1 report only as the data between both files is linked by transaction id.Please advise if that is possible.
Note - I only use Crystal Report V14.0.4 to create the rpt file and don't have the .net assembly to do it through programming.
Not possible with Crystal Designer alone.

Crystal Reports 2013: Conditional rendering based on export format

I am developing a report in Crystal Reports 2013 to publish to a Business Objects server. The user wants it to be able to run to HTML, PDF, Excel, or CSV. If I make it compatible with CSV (a raw data dump with one row per record -- for use downstream by a machine) it will be too wide to fit on one page for the PDF output. We have no direct control of the Business Objects server. This is all done through the cloud application.
...and I'm new to Crystal Reports...
Is there a way to create two sections in the report -- one for CSV and one for PDF -- and have one render (or hide) when the report is run to Excel or CSV and the other render (or hide) when the report is run to HTML or PDF? How?
No, but you can create a parameter that prompts the user for desired layout ("For PDF", "For CSV") and use that parameter in the dynamic expression for section suppress attribute.
Assuming they don't, you can always go to plan B and simply create 2 different reports.

SSRS Dynamic Filenames for Email Subscriptions

We are in the process of migrating our reports from Crystal Reports to SSRS. In Crystal Reports we use variables to dynamically generate our filenames so when the report gets sent out via email, the file has the report name and execution date. (e.g. MonthlyReport09-07-2012.xls).
Is this possible in SSRS? I don't see any straightforward approach to using variables in the filename when subscribing to a report. This could prove troublesome when sending multiple reports with the same filename to the same person because it would be difficult to discern which report is which.
Any help is greatly appreciated. Thank you SO.
There is no feature in SSRS as such but there is a work around for this. You have two options
Option 1:
Instead of emailing it directly first dump the file in fileshare location which can be something like \machine-name\ExportReports\ReportName\ then create a windows job which renames the file to the format you want and emails it in the next step.
Option 2:
Refer to this blog what you want starts from section "Generate a PDF output file programmatically" now you can use this in an assembly then have some scheduling mechanism which picks up the schedule. This then calls the DLL which generates the report and emails it.
Use #timestamp in the name of the file and it will translate at run time.
You cannot specify the report filename in a standard subscription in Reporting Services.
If you have Enterprise edition (or SQL 2012 Business Intelligence edition) you can use the Data-Driven Subscriptions features that allows you to specify the report filename (and other properties) based on data retrieved from a table.
If you have Standard edition, then your options are either of the ones suggested by Bhupendra, or you could look at scripting the report generation using the "rs.exe" utility supplied with Reporting Services and use Database Mail and SQL Server Agent to handle the emailing and scheduling.
This post looks pretty old , but better late then never ...
There are some tools on the market , which can run SSRS reports : CRD, R-Tag and RemiWare
These are Desktop tools but I guess you are not looking to replace SSRS , just to extend it.
I am not sure about the CRD and RemiWare , but R-Tag supports data driven reports and dynamic names. It also can be used with Standard license.
I was able to automate the emailing and change the file name by looping thru a table of accounts, invoices and emails, then setting the parameters and renaming the reportname and pathname in catalog be execution at the end of the after the execution I did a wait for 2 seconds then when to the next loop. I the end I set the path and name back to orginalname. Performed well.
#timestamp works for Windows File Share as answered by Chris.
For Email deliveries, you could use:
#ReportName -specifies the name of the report.
#ExecutionTime - specifies when the report was executed.
For more details- MS Docs
You can do this by changing the filename directly from the table [ReportServer].[dbo].[Catalog]
Make sure to add a forward slash to the Path
For e.g. I created a SQL Job that ran every night before the report and added the date to the filename.
Sample Job (replace [ItemID] corresponding to your Report):
DECLARE #PREFIX CHAR(25) = 'REPORT_NAME_';
DECLARE #SUFFIX CHAR(8) = CONVERT(CHAR(8),GETDATE(),112);
DECLARE #VARNAME CHAR(33) = CONCAT(#PREFIX,#SUFFIX);
DECLARE #VARPATH CHAR(34) = CONCAT('/',#PREFIX,#SUFFIX);
UPDATE [ReportServer].[dbo].[Catalog]
SET
[Name] = #VARNAME,
[Path] = #VARPATH
WHERE [ItemID]='63D051EE-3139-4F50-ADBB-1C944F3D5D47';

Reporting Service: Change reports based on format

I have a report that will be viewed from SSRS report manager and scheduled to send a flat file as well. The problem is that the rich display, summation rows, and some other elements that are perferred when viewing the report online or as a PDF are not wanted when the report is viewed in Excel or when it is exported to CVS. The solution I proposed was to simply have two reports. One that was nicely formated and the other that was more of a raw data feed but they want only one report meaning that I need a way to show one thing if it is viewd online or saved to a PDF and something different when it is saved to CVS or XLS. Is this possible and if so how?
When exporting to .csv format, many fields are stripped. Have you looked at what the existing functionality does to your report?
If that's not adequate, you can use the new SSRS 2008R2 global variable to change item visibility. For example set the hidden function to:
=(Globals!RenderFormat.Name = "EXCEL")
This would hide something when exported to Excel format. (This is only available since SSRS 2008 R2.)
More info on this at:
http://blogs.msdn.com/b/robertbruckner/archive/2010/05/02/globals-renderformat-aka-renderer-dependent-report-layout.aspx