Dynamically expanding field headings in crystal reports - excel

I have a report where I have 50+ fields and I am exporting this report from crystal to excel. Once in excel the data columns are the proper width but the headings are truncated. Is there a way to get the headings to dynamically expand like the data does?

Have you tried using the grid line tools to line up all your columns and headers? Ensure snap to grid is on and that all headers/fields are the same size on screen.
Basically you want the crystal report in the designer to look similar to an excel report; with all the headers and fields in a grid like structure.
Crystal also produced a document many moons ago when they were owned by Seagate describing how to avoid formatting problems when exporting to excel. Check it out HERE
This helped me a load when I had to build stock reports and summaries for one of my customers.

Related

Crystal Report display data in a box

I need to display data in a crystal report in this format. I am new to crystal report I have no idea of doing this. Please help on this how can I draw these outer lines. The database is access
In the menu, click insert and use either line or box or a combination of both to create outer lines for data. If using a cross-tab, report, use the format cross-tab for line properties.
There are numerous resources online to learn about CR.
Example: https://www.crystalreports.com/guides/#lp-pom-block-1322

Programmatically add rows to an Excel data model via C#

We're looking at allowing our customers to download an Excel file from our web application which contains a raw export of their data along with some basic charts and pivot tables based on that data.
The basic way, we want to make this work is that we have a fixed Excel file which contains all the reporting elements in one worksheet and have room for the underlying data in another worksheet. When the user requests their Excel report, we programmatically fill out the data worksheet with their results and send them the final Excel file.
Everything seemed a bit to easy when doing the prototyping with a fixed set of data. The dataset we worked with was added to the Excel Data Model and we then set up the charts and other reporting elements. However, when using that file as the template for the generated Excel file in our application we are finding that the definition of the data model still remains - meaning, that we built the "protype" with a table definition of $A$1:$T$5879
but when generating the report, that definition isn't changed to contain whatever size the added dataset might have.
We're using EPPlus to work with the generation of our Excel sheets and have so far been unable to find any sort of solution to this kind of problem. This might very much be due to us being quite Excel novices. The goal is to have the user experience, that the charts and pivot tables contained in the Excel sheet reflects the total dataset contained in the Excel file without them having to do anything.
Ok, I've actually found a solution for it.
The solution was right infront of us.
We define the dataset as a named set - this is done under under the "Formulas" and inside the "Name Manager". We have a range which defines our dataset - the "Refers To" field when defining a range can take a formula. So intead of giving it a fixed size, we use this: =OFFSET(Data!$A$1;0;0;COUNTA(Data!$A:$A);COUNTA(Data!$1:$1))
This counts the amount of rows and columns, with reference to A1 in our Data worksheet. All our pivots are set to reload on startup and that seems to work.

Can I create a non-pie chart using Excelwriter and SSRS Integration?

I'm using SoftArtisans ExcelWriter for SSRS (ver 8.6), and am wondering if it is possible to create a (non-pie) chart, e.g. a Stacked Bar chart, that has multiple series?
I can create pie charts easily enough, and that is what the help docs show, but there is no samples for other types of charts for SSRS integration.
The excel template is embedded in the .rdl file, and the spreadsheet is created when the user exports the generated report using OfficeWriter's Excel rendering extension. However the report is run manually by users, so I don't have the ability to execute any code to modify the Excel object before the user sees it.
Can anyone either confirm that only pie charts are possible for SSRS Integration, or provide some insight into how other chart types are possible?
You can create any type of chart that Excel can create, since you are creating your chart in your template file with Excel.
Here is an example of how I setup my template to build a scatter chart (Please ignore the title of the chart, I forgot to rename it from Pie Chart).
I insert a chart into my template, set the type to be scatter, and I placed 4 data markers under my chart, from two data sources.
Next I edit the Chart's series and point them to the data markers in my file. When the template is populated from ExcelWriters SSRS integration, it will replace all the datamarkers with your data, and update the chart's series.
After redeploying the template file to my report server, I can now export the file to Excel for OfficeWriter, and my output is shown below.
Disclaimer: I am a developer on OfficeWriter and work for SoftArtisans the makers of OfficeWriter.
Please let me know if this helps.
You should be able to create any type of chart.
The way that OfficeWriter SSRS integration works (and just the plain Template object for that matter), is that it takes all of your data and inserts it into your data markers. Then it finds references in your workbook that pointed to your data markers, and expands them to point to all of the new inserted data.
So really you can add any type of chart. You just have to make sure that the chart you create points to the data markers as the source data.
A data marker will correspond to a single series or to horizontal axis data. Then as the data is populated, the values in the series are populated.
On our reporting demo page there's a link at the bottom that says "View Report Template" that you can click on to download and Excel file that shows a variety of different charts pointing to data markers.

Large Excel File From SSRS Sorting

A SSRS 2005 report that is run by multiple users is generating about 45,000+ records and then being exported to Excel. This is working fine, but when the users try to sort/filter the results they are seeing a huge amount of lag. At first I thought that it was just because of the large number of rows, but we found that when we stripped all of the formatting from the Excel file the report sorted and filtered quickly. Is this a common problem any of you have seen and how would you resolve it? They need the formatting to stay on the main report, so if I could somehow export without formatting that would be ideal.
Thanks!
There are only three settings you can set for the ReportViewer excel renderer.
See Excel Device Info
Unfortunately, none of which will omit formatting in your exported report.
The only thing I can suggest is that you strip out all the formatting from the RDLC report file, prior to exporting.

CrystalReports excel field cut off when using CanGrow=True

I am working on an excel report in CrystalReports, in VS2005. I have a field in the Details section which can have up to 255 characters of text, and I want the height of the row in excel to expand so that the entire text can be seen initially when the report is generated.
I set CanGrow=True in the field's properties, and the field does seem to grow; the field is only one line (Height=159), but many of the rows display multiple, wrapped lines of text. Some rows intermittently have the bottem half of the last line of text cut off; the user has to expand the row a little bit to see it. There doesn't seem to be a particular field length that causes this - in one case, it has four lines total in the output, and in another case, it has only three.
Can anyone suggest what might be the cause of this, or how I could work around it?
Thanks in advance for any help you guys can offer.
[Edit: I am no longer working on this project, so I never found out what became of this setting. Most likely it wasn't fixed, since it's not a critical issue.]
One solution to this issue that I've come up with in the past is to have two separate reports. One for display and exporting to pdfor rtf and another report for exporting to Excel.
I know in general this is not a good approach because there is the possibility for data to be different in the export than the display report, but if careful it works well.
I have a situation where a client needs data printed in a specific format on a report, but there is way to much data to physically be able to fit on a page. We worked out a solution that I run a "display version" of the report that fits most of the data, but the rest of the data necessary for there client is added only to the "Excel version" of the report.
To do this I simply load the "display report" to the report viewer as you normally would, but when you go to export the report I load the "excel report" with the same parameters as the "display report" and call the code to export the data to Excel.
By using this method the "display report" can be formatted any way necessary without having to worry about messing up the export to excel. The excel report fields can then be made a smaller size than required by the display report because the data should export even regardless of the size of the field. Doing this allows you to fit more data on the Excel export report.
Since both reports use the same datasource you will have an issue if you make a change that you have to remember to go verify the database on each report to see the new database changes, but this method allows you to include more data and in a different format than the display version of the report.
Hope this helps.
While not a solution for Crystal (I don't know of one), as part of the reporting team at GrapeCity-Data Dynamics, we've worked with similar issues taking free-form reports to excel spreadsheets for a decade. In our Data Dynamics Reports product we came up with a completely new way of solving the problem of exporting reports to excel.
We allow you to create a template for the report output. The template is a basic excel file with place holders for the various textboxes (or other controls) and regions (tables, lists, etc.) in the report. You can open this template inside of excel and modify the properties of the cells and rows. In the scenario you describe, you can export a "template" from Data Dynamics Reports and then modify the autosize property of the row in the template containing the placeholder for the textbox you're struggling with.
When you export the report to excel next time, just specify the template to Data Dynamics Reports (which can be done programmatically and transparently to the end user) and Data Dynamics Reports will honor all settings you specified in the template.
This is hard to explain so there is a ~2 minute screencast that shows this feature at our website in the following location:
http://www.datadynamics.com/Products/DDRPT/ScreencastViewer.aspx?ID=XLS01
For more information about the product and for a free trial download visit: http://www.datadynamics.com/DataDynamicsReports
Scott Willeke
GrapeCity - Data Dynamics

Resources