Word Document Template - Embed after Crystal or SSRS - sql

I am working with a crystal report that has the first few pages populated with a few fields from the database and the rest of the report has sections of static information (mostly legal terms and conditions).
Now the report runs fine but I am running into a lot of issues when I have to update the terms and conditions text every time there's a change. It may sound easy, but Crystal is extremely finicky when it comes to handling formatting copied over from a Word Document. This makes it extremely difficult to work with.
I am exhausted of ideas trying to make this work, but is there any way to keep that static text independent from the report? Is there anyway to give control of the document to the users so they can change it at will and be stored on the network somewhere that gets called in and embedded onto the report?
It needn't be just a crystal report, it can be a SSRS report as well, it really doesn't matter.
TLDR; Need help embedding contents of a document file in a Crystal/SSRS report that can be sitting out on the network somewhere.
Thanks for the help in advance :)

If you are exporting the report to a PDF you can create just the page with the database information in the report and append the static text as an external PDF files. You will need a 3rd party tool to run the reports.

Related

Not able to preview RDLC report in VS2013 because of blank data source instance

I have been struggling with this issue for two years now. My problems are happening in Visual Studio 2013 (not a web server).
Occasionally, I have to take an RDLC file that was created by someone else and make changes to it. Using VS, I create an XSD file for the dataset, then replace the DataSource and DataSet in the RDLC so that the report now points to the tableadapter(s) in the XSD.
Often when I try to view the report in the ReportViewer form, the Report Data Source and Data Source Instance are blank. I've tried Rebind Data Sources, and I've cleaned and rebuilt the project, but I can't get the data source to show up. Sometimes the report will have a subreport, and that data source will be available if I choose that RDLC.
I'm a third party developer -- I'm not editing (and cannot edit) aspx files; just the reports. I've tried editing the code in Form.vb manually to insert the TableAdapter, but it hasn't worked, and I don't really know what I'm doing there -- I have some object-oriented programming experience, but not much.
What can I do to make the data source available to the report viewer and/or bind it to the RDLC? Any suggestions are appreciated. Please let me know if there's any particular code it would be useful to share.
Thank you.
I ended up doing the following, which solved the problem in this case. Not sure it's a solution that will work in all situations like this.
I replaced the opening Report tag in the XML of the RDLC with this:
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
I removed the <ReportSections> and <ReportSection> tags, as they are not supported by the 2008 schema. I didn't remove anything that was between the tags.
After making these changes, the data source became available to the form, and I was able to preview the report.

Crystal Reports vs. SQL Queries

I'm a programmer (mostly C++) who has moved into a non-software workplace. However, I don't have much experience with database stuff at all.
TL;DR: If we compare Crystal Reports to just writing scripts that execute SQL queries and parse the results, is there anything that CR can do that isn't possible via SQL queries & scripts? I'm talking purely in terms of extracting data - not making pretty documents.
Detail:
At my workplace they have a process where you run a bunch of Crystal Reports, modify the date range to the current month, manually export each to excel, delete the rows and columns that aren't needed, and then cut and paste into a summary excel document that is used by management.
To me, this is pretty crazy and stupid. I'd like to automate/script most of it.
So I have two options:
Learn Crystal Reports and try to modify the existing reports to be more automated.
Dump CR and just learn SQL and do the whole thing programmatically with scripts working with CSV files or something.
I'd much rather learn SQL since it's more general and useful. But I need to be assured that I can get the data output that I need (without writing a million lines of code to reproduce CR myself.)
So yeah, I'm looking for an answer like, "The two are equivalent. Anything you can do in CR you can do easily via scripts and SQL," or "If you need to group records into categories based on a parameter and then sum their one of their fields, then CR will do it much more easily than raw code," to push me in one direction or another.
Edit:
Some additional detail. At the moment my crystal reports run a database query, and then crystal does things like, "don't display the records that are returned, instead group the records by Field A and then display the count of how many records in each group."
Is functionality like this difficult to reproduce via SQL coding? I wouldnt want to have to write a python (or whatever) script to parse and manipulate the data from plaintext CSV, for example.
You can't just compare SQL and CR - they have different purpose. SQL (in this context) is data source, CR is pretty output formatter. For excel you would need data, not formatted output. Excel combined with SQL can give you all CR options (dynamic crosstab reports, charts etc) what you can't get directly from SQL data.
BTW, creating SQL views or procedures is often needed to overcome CR limitations; from this standpoint SQL has lot of more options than CR.
I personally would go with SQL+Excel route. In our company we're using simply SQL+CR without postprocessing, sometimes SQL+Excel. Our customers are using different approaches.
But like said by other people, choice of tools depends on more things. Who has to redesign reports? Who will maintain these reports? How often requirements change? Are there more uses for CR reports besides sourcing Excel tables? Who will be waked up at night, if reports do not work?
Management perpective:
In many I will say mostly cases management does not know SQL. So if a manager for E.g.HR wants to know staus about something then how he will get that status?? This is where Crystal reports come into picture, Using crystal reports they do not have to worry about SQL; they will just enter required fields and get their data.
Programmer perspective:
Simple data outputs can be achieved through SQL but consider a scenario where you need to pull details as well as summary. I agree it can be done via SQL but consider the overhead of time and proficiency required to develop such output using sql. I bet it wont be that easy to develop such output using sql as compared to crystal. So I will say learn both SQL and crystal, you will get to choose the tool to apply for your requirement.
You can write SQL and drop it into the Crystal Report. Best of both worlds, and possibly faster performance than the drag-and-drop Crystal functionality.
You will see some response time lag when the report runs.
There are actually a few things that Crystal Reports can do that are very tricky using plain SQL Queries as Crystal Reports can access the entire dataset in a single formula and can do things at runtime.
However unless you have some really crazy complex Crystal Reports I would recommend building a tool in Excel that can one click the info straight into a new sheet.
I did this and it got me a promotion, not kidding :P
I have a custom Excel Addin I can give you code to that basically does this:
On open, connects to the database and downloads a list of menu options connected to views and procedures
Adds these menu options into a new Ribbon tab within Excel
When one is clicked, runs the view and dumps the entire dataset (properly formatted) into a new sheet
Advantage of this is you can update the main menu list and each view it references without making any changes to the file or re-issuing anything to everyone.
Crystal could be helpful if you want to create a document with a specific layout , logos etc. and show some data on it. Export to excel from Crystal repot is not easy - usually there are a lot of empty columns and rows and each report should be tweaked to avoid that.
If you need to export some data from a SQLServer database to excel your best option will be SSIS ( I guess you have a license for SQL Server). If you don't have license for SSIS or you are using for example Access database there are also some inexpensive tools, which can retrieve data from any database ( not just SQLServer) and export it to excel. I would suggest you to check this one: http://www.r-tag.com. It can run Crystal reports and SQL reports so you can start using your crystal reports immediately and start transforming them to SQL reports whenever you have time for that. Both reports could be exported to excel.
i fixed this by editing excel sql, Left(Column_maxLength, 250)
this resolved my issue
in my case if even if i read left 250 character is enough

Merging the result of two prpt reports into one PDF in pentaho report designer

I have been looking all over for this. I have two seperate prpt files and I am able to generate the pdf's for these prpt files. I would like to combine both the reports into a single PDF with two pages. I would like to do this either in Report Designer or in Pentaho Data Integration. Please can someone help me out with this.
Thank you.
You can do this via a subreport in Report Designer - no need to use the DI tool. You create a new subreport in the parent report, then paste in all the elements from the child. Not very clean admittedly.
Alternatively if it's a very complex report you can unzip the prpt, insert the child report and re-zip it. But this is tricky - and there's some constraints about what must be done where!
If your sole purpose is to merge the pdf documents (and not the prpt files): There is a free open source tool called pdfsam which is capable of merging multiple pdf documents. Alternatively and if you are not reluctant to upload maybe sensitive data you could use an online service, e.g. mergepdf by foxyutils

Failed to retrieve data from the database, Database Vendor Code 9421

I have a report made in Crystal Reports XI. The report is generated and exported to PDF in visual basic script using COM interface. Generally everything is running smoothly, but in one case generation breaks with error:
Failed to retrieve data from the database. Details: [Database Vendor Code 9421]
Database used is MSSQL 2005 connected over ODBC to CR XI. When I am opening report with exactly the same parameters in Designer, everything works fine.
It looks like it is data related, but it is hard to trace since the whole report is pretty sophisticated. Anyway I spent half a day on crawling over Dr. Google and it seems that he has no clue what might be an issue.
When you previewed the report in Crystal Reports Developer, did you look at the whole thing? Some custom formulae are not calculated until you actually look at the page.
Try scrolling through the entire report top to bottom. If your error message pops up halfway through and Crystal refuses to preview the rest of the report, then there's probably some anomaly in your datasource that is tripping up a custom Formula in your Crystal Report.

Using a Word document as a template for an SSRS report?

Greetings.
I've got a few Word documents that I need to send as notifications when something happens. I've got to fill 10 parameters or so from our SQL Server database. Note that I don't need to send them as word documents, PDF will be fine - I was just given them in .docx form.
Now, I immediately thought SSRS was the way to go here. Now that I've spent some time with the Textbox control and it's lack of formatting (SQL2005), I'm not so sure.
Anyone have an idea for a better way to go about this? Right now I'm using TONS of textboxes as I've got to have certain things underlined, certain things bolded, plus all of the parameters that need to be filled.
There's got to be a better solution. Thanks!
Is Reporting Services the right tool for this job? You could easily automate Word 2007 using Visual Studio Tools for Office, do a merge with your data and mail out the actual documents or a PDF of them.
I haven't tried it myself, but this might be worth a look.