Crystal Reports 2013: Conditional rendering based on export format - crystal-reports

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.

Related

How to make Jaspersoft Studio export to xlsx without repeating column header (as JasperReports server does)?

Jaspersoft Studio exporting to xlsx has this annoying behavior of "paginating" an Excel sheet as if it were a page oriented document.
There is an option in exporter to put one page in each sheet, that's not what I'm talking about. It prints everything in a single sheet, but repeats the column header band (the names of the columns) and page footer band every dozens or rows, as if it were a paginated document like a PDF.
I know it's possible to prevent this because if I run the very same report on JasperReports Server it will work just fine, i.e. will print column header every page if I export to PDF, but will not if I export to xlsx or xls.
I've played with many options for XLS exporter in Jaspersoft Studio and many export configurations of the report without success. My Jaspersoft Studio is configured to reproduce what JasperReports Server does in terms of xlsx export, but I don't think any of these export parameters really deal with pagination.
For this I just put $V{PAGE_NUMBER}==1 in the "print when" field on the column header properties, then it should only print the column header once. Not sure though about the page footer I'm afraid as I don't use them but imagine that would obviously could/would change.
Enable Ignore Pagination
Here is what you need: Check the Ignore Pagination in report's properties

Crystal Reports : Crosstab refuses not to paginate

I am using Crystal Reports 11 (XI) and I have a crosstab that has quite a few rows to it. Its publishing format is to Excel, so pagination doesn't really even make sense. However, no matter what I do it repeats the column/crosstab headers every couple dozen lines. I've tried:
-Increasing page size definition to max size (12x18) portrait
-Turning off pagination in the output settings
-Turning off horizontal pagination
-Deleting column headers (works) but I cannot delete the crosstab header
I'm running out of ideas.
If the goal is just to create an excel file with some pivoted data crystal reports is not the best way to do it. Check the first 5 minutes of this video:
http://www.r-tag.com/Pages/Preview_Demo.aspx
It compares the same data presented as a cross-tab in Crystal reports and pivot report based on a SQL ad-hoc query. SSRS is also part of the comparison and it is a better choice than Crystal too , but SQL ad-hoc query is my favorite for pivoted data.
P.S. I am proposing this alternative because the tool is free, it will save you development time and will create a better formatted excel file. If you are using BOE and you want to keep the report there this might not work for you.
The solution is as contrived as the problem...
There is no way in Crystal XI to "turn off" the crosstab pagination. It simply cannot be stopped. However, you can cheat the system by configuring a massive page size. In windows on your development machine, locate your XPS printer virtual device and choose "Print Server Properties" (in the top banner in Win 7+)
In the "Forms" tab, you will be able to configure a new paper form object of arbitrary size. Click on "Change Form Settings" and create a new page that is as large as you think you will need. I'm not aware of any limitations on this configuration, but I'm sure bad things happen if you go nuts.
Returning to crystal, go to printer configuration and select the XPS document printer as your target device for exports, and save the custom page size as the target paper type.
Now, the crosstab will assume you are printing to a massive sheet and will not attempt to paginate. As far as I can tell it's impossible to achieve the same effect any other way.
Here is a introduction about jasper crosstab.
http://www.tutorialspoint.com/jasper_reports/pdf/jasper_crosstabs.pdf
From the document, you can add two attributes in node
<crosstab isRepeatColumnHeaders="false" isRepeatRowHeaders="false">
...
</crosstab>

How to avoid blank report export to Excel in SSRS 2008 r2?

Hi I developed one report which is taking parameters dynamically with help of Data driven subscription.
but when I did subscription it is exporting all users reports into Excel and keeping it into windows file share folder.
here my issue is my client doesn't want the report if report is empty for a particular user.
but I have to fix this issue in SSRS itself instead of doing changes in Procedure (database) level.
i used the below expression in SP Level
i.e
if(##rowcoun>0)
raiserror("nodata",16,1)
Note: but the same procedure is using for multiple purpose and my db developer is not accepting to do changes in SP levle.
in reports level i am using the below expression to hide the column headers if report is empty
iif(countrows()>0,"true","false")
but the above expression showing blank report and it is exporting empty excel sheet for the user.
Thanks in advance
Since you are already using a Data Driven Subscription, what you need to do is edit the subscription query so that it creates a list of recipient emails based on those with data. The way I do this is to join the table of recipients with the dataset to be returned.

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

Crystal Reports Excel export with worksheets

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.