Programmatic Report in Lightswitch - c#

Is it possible to create a report programmatically in Light Switch?
I would like my customer to enter data and upon saving, a report is automatically generated and saved in a specific location.
Thanks

Lightswitch doesn't have built-in reporting. There are a number of options including third-party extensions,custom silverlight controls, SQL Server Reports, and integration with microsoft office. A summary of these options is at http://msdn.microsoft.com/en-us/library/vstudio/jj635143.aspx If your program operates in a desktop environment using office may be the easiest. I've used http://blogs.msdn.com/b/bethmassi/archive/2011/09/22/fun-with-the-office-integration-pack-extension-for-lightswitch.aspx as a guide successfully. You can even automatically save (as an office file or a PDF) to a specific file path. As far as I know, if you are running in-browser you will not be able to automatically save the file - but there are still plenty of options.

Related

Publish report to Shared folder from C# or through SP(SQL Server 2008)

At high level, this is my requirement.
We have a windows application, which hosts several report(built using SSRS 2008). Now, we have got a requirement like, whenever the user generates a specific report from the application, the same should be saved in csv format in a shared location.
Of couse, once the report is generated, the users have the provision to save the report in any location they want and in all possible formats as allowed in SSRS 2008,but they feel it is becoming an over head for them. So, they just would like to give necessary inputs to the report through the parameter screen(basically nothing but the small dialog which accepts users input and generate the report) from the windows application and once they click on 'Generate Report' or 'OK' button, they want the report to be stored in a shared location in CSV format with a unique name(format:OrderNumber_DDMMYY, here the order number is unique always. the order number is provided as input through report parameter screen).
We have developed the windows application in VS 2008, now migrated to VS2012 and the backend is SQL Server 2008. We also have a dedicated sharepoint.
Can anyone throw light on the best way to achieve this?
Here's something that might be able to help you.
http://www.codeproject.com/Articles/699869/Accessing-SSRS-Reports-from-SharePoint-Site-using

ASP.NET reporting, what, how and when to use RDLC

I am new to reporting in asp.net and can't get the things work up good for me.
Basically, I made a demo of what was told here. Everything worked fine and it generated report on my local system. But, did not worked on the web server.
Now, I've got a confusion here: There are 2 modes of a reporting in asp.net [VS 2010 - .NET 4.0], Local Mode and Server Mode. Local Mode has RDLC extension and Server mode has RDL as extension for the report design file, and it requires Sql Server reporting for support, for which on the other hand RDLC is made on the Client Machine [it may look to be a dumb question but, is it my machine or my pc and not the web server, means I cannot deploy and use it on the web server].
The base of the confusion is that I had uploaded the same demo project on my web hosting and ran it. The report Viewer control was showing perfectly and every thing was looking fine, but the actual report that was to be rendered was absent from below of the Report Viewer Toolbar. But, at the same time, I was able to download the PDF, XLS, and DOC format of the report completely fine, with the actual rows and columns generated, which shows that the report was being generated (A bar graph was also included in the design of rdlc, and it generated as well). I guess this was because the web-server did not had Report Viewer libraries installed on it, and did not know how to render the RDLC file.
So, here are the actual questions:
Am I correct in the thinking that a report can be generated on the webserver when you have RDLC as the report file format?Or should I use the RDL instead?
If I deploy my application with RDLC (Local Report), of-course on the web server, will it work fine? Is it possible to install or get the report viewer installed on the web server
And when should I use an RDLC and RDL and when not. A previous question When to use RDLC over RDL reports?., but I am looking for a simpler explanation in my scenario.
RDLC
Its client side reporting, Reports are shipped with the applications like windows app or web app.
Limited functionality in terms of formats in which the Report could be exported.
Report's data processing and rendering consumes address space of application in which Reports are hosted, it could be windows or web. This could cause performance issues if you pull huge reports often.
This does not require any separate SQL instance or licence.
RDL
This is server side reporting, reports are processed at dedicated server process called SQL Reporting Services' service and output is fed to applications or end users.
Server reporting is designed to perform and scale.
Runs as a separate process/service and requires SQL License.
Provides export to multiple formats not available in RDLC
Server reporting is extensible product. You can include your own data processing, security or delivery extensions.
It supports automated email delivery and file delivery of reports using Subscriptions out of the box.
Summary
Consider client side reporting (rdlc) if you are going to use simple and smaller reports not very often.
Consider (rdl) if you want to setup dedicated and central service to cater your Reporting requirements for various application users. This could be extended, monitored, optimized and scaled out on demand.
RDL and RDLC formats have the same XML schema. However, in RDLC files, some values (such as query text) are allowed to be empty, which means that they are not immediately ready to be published to a Report Server. The missing values can be entered by opening the RDLC file using the SQL Server 2008 version of Report Designer. (You have to rename .rdlc to .rdl first.)
RDL files are fully compatible with the ReportViewer control runtime. However, RDL files do not contain some information that the design-time of the ReportViewer control depends on for automatically generating data-binding code. By manually binding data, RDL files can be used in the ReportViewer control.
Note: that the ReportViewer control does not contain any logic for connecting to databases or executing queries. By separating out such logic, the ReportViewer has been made compatible with all data sources, including non-database data sources. However this means that when an RDL file is used by the ReportViewer control, the SQL related information in the RDL file is simply ignored by the control. It is the host application's responsibility to connect to databases, execute queries and supply data to the ReportViewer control in the form of ADO.NET DataTables.
Reference: http://forums.asp.net/t/1173578.aspx/1
Also check: http://dinesql.blogspot.com/2010/11/reporting-services-difference-between.html

How can I generate a report in WPF?

I'd like to know of any tools to generate a report in wpf.
What I want to do is to generate the report and export it immediately to a pdf, csv or just print it. I don't want the client to be able to "adjust" the report from within my application. Also the report tool should give me lots of freedom, since I'm geerating reports from a datagrid that is constantly changing, according to the user's commands (in other words .. it's dynamic)
Does anyone know of any tools that allow me to do that (preferably an open source tool, but I'm not tied to it being open source)?
Reporting isn't specific to WPF. You can look at Crystal Reports, SSRS Reports (both server *.rdl and client embedded *.rdlc), or tools from companies like DevExpress' XtraReports.
The +1 for using SSRS Reports is that there appears to be a Mono project that will allow you to render them, so you're not tied 100% to the Microsoft server stack, if you have that requirement. Look at FYI Reporting from the provided link.
If you are familiar with crystal reports, this may be useful to you. Otherwise you could always use xslt and xml
This answer makes a a compelling arguement for micrsoft or third party reporting compared to xslt "hand made" reports.
Edit: As a first go, it may be adviseable to use the crystal report creation wizard
You can use Crystal Reports, just like we use it in WinForms.
You have several options here.
You can print a visual to pdf using a virtual printer: http://www.pdfforge.org/products/pdfcreator.
There are also XPS to PDF converters.
And, of course, there are numerous WPF based report generators.
You're question is quite clear, so I wasn't sure what exactly you were after.
You may consider using ActiveReports to fulfill your reporting needs as ActiveReports has a viewer and end user report designer control which can work quite well in WPF environment.The End user designer control will also allow your end users modify reports at their will.
Regarding the exporting capabilities , ActiveReports will let you export to PDF,Excel,Word,Tiff,Jpeg,Text etc.And lastly activereport will give you the flexibility you are looking for as it can be bound to datasets,XML,OLedbm,sql,Excel sheets, text,array, objects etc ..
You can visit these links to know more how ActiveReports works on WPF:
http://blogs.gcpowertools.co.in/2011/11/how-to-view-report-created-using-active.html
http://blogs.gcpowertools.co.in/2011/08/how-to-host-active-reports-end-user.html

Good web reports designer

I faced wuth task of creating system that will generate various medical papers for patients based on DB data. There is a lot of 3d party companies that will use this product therefore this product will be web-based. The main purpose of this product is printing this papers I have described above. Users already has prepared paper blank on which personal information will be imprinted. All users has various printers and the main issue I need to solve is that every printer prints in own maner and imprinted characters losts their positions.
The possible way I can solve this is to provide reports designer embedded in system, that allow every user "adjust" report to get printer prints properly.
By the way, we has all necessary documents reports storing in .fr3 files. It's 'cause we use same reports in another desktop application and we use fast report engine in that application. So the only one web reports designer I have found is Stimul soft reports web designer. But it's big, awkward and seems too heavy for this small project. Could you guys advice me some lightweight web reports designer/engine that can solve my issue?
P.S.: sorry for my English. I will use ASP .NET MVC3 (C#) for implementing this project.
The key question is do you need report design via the browser, do you merely need printer positioning, or can the report design be performed on the user's computer and it's just report generation that must be on the browser.
If you need report design in the browser then you are limited to products like Stimulsoft which as you said tend to be ackward and limited.
What you may be facing, based on your question, is that you need to position the report on the printer as all printers set the upper left of the generated report in a slightly different place on the paper. The best way to handle this issue is to make your report work fine regardless of the upper left of the printing on the page as the differences are small. But if that won't work, just prompt the user for the adjustment values.
Finally, if you want a system where it is very easy for non programmers to design reports, and the designer can be on their computer, please take a look at Windward Reports (disclaimer - I'm the CTO at Windward. With Windward you design your reports in Microsoft Word, Excel, or PowerPoint so it is both very easy and very powerful.
I does not understand what your problem is with position. A normal reporting solution print identical on different printers (not valid for old 9 dot printer).
Do you want print in a form (blank)? i-net Clear Reports has a page option for form print and an Online Designer. You find the form print option in the page setup dialog. If you enable the form print option the left and right margin will not change and the print will not scale.
Or do you search a simple designer in a browser? Then you can take a look in the ad-hoc reporting.
Use SQL-Server reporting services (2008 R2 in it's latest and most bug-corrected version).
It can render to HTML, and export to PDF, XLS, CSV and to Word (Word only with a commercial custom extension).
It also has a COM-object, which allows the report to run standalone, without SSRS installed.
SSRS also supports OracleProvider, apart from SQL server.
If a MS-SQL dependency is an overkill, you could take a look at Eclipse BIRT, which is a Java SSRS clone, which has a web viewer and JDBC database connectivity (however, the report format is not compatible).
The bad thing about it is, that it requires the version of Visual Studio that came with the SQL server version (so no designing of SSRS 2008 R1/R2 reports in Visual Studio 2010, you need Visual Studio 2008).
take a look into List & Label. It has a Webserveredition for generating output on web-applications and if you need to modify them there is an ActiveX available. We've done some successful projects with this stuff. Just try it out!
Take a look at Izenda AdHoc
.
In-browser Designer, In-browser Viewes, highly customizable but very simple API, exports feature, multiple databases types support.
You could even change reports looking using CSS styles.
Of course, compatible with MVC.

Reports in a .NET Winforms App

I'm writing a Winforms application and I've been writing these awful HTML reports where I have templates set up and use String.Replace to get my variables into the templates, then output the results to a WebBrowser control. I really don't like this set up.
I'd love to be able to use ASP.NET for my reports, but my clients don't want to have to run IIS on all the machines this is getting installed on, so that's not really an option.
Have you tried the reportviewer control? Your customers will be happy with the fancy new reports. It is template based and can include data from database or from code data, you can use parameters, images, and the result can be exported to Excel or to PDF.
Plus the control has some basic functionality like paging, zooming, printing, finding...
Why do you need ASP.NET? I don't see, what difference it can make. Maybe you can render your HTML more easily, but it's still not "real" reporting.
Like was said earlier, use the report viewer with client side reporting. You can create reports the same way as you do for sql reporting services, except you dont need sql server(nor asp.net). Plus you have complete control over them(how you present, how you collect data, what layer they are generated in, etc). You can also export as PDF and excel.
Here is a great book i recommend to everyone to look at if interested in client side reports. It gives a lot of great info and many different scenarios and ways to use client side reporting.
http://www.apress.com/book/view/9781590598542
While I haven't used it, I hear a lot of podcast ads for Telerik reporting. Might be worth looking at. Looks pretty sweet.
You can use the version of Crystal Reports included in Visual Studio and save the output to a .PDF file which wouldn't be too clumsy to read from a browser. (That's what I did on my last contract)
Why not using xsl to generate html reports? Much nicer than doing string replace.
You might look into Cassini -- a free ASP.NET web server component that you can embed directly in your WinForms application. The UltiDev version (linked) is based on the code that Microsoft released back in .NET 1.0, which was also used for the Visual Studio 2005+ Development Web Server.
For an advanced reporting solution that goes beyond the dataset only reportviewer in VS, you should consider Data Dynamics Reports
It offers all that is in SSRS and adds Master Reports, Themes, Calendar data region, Data Visualization (Databar, Sparkline, Iconset, ColorScale, ...), complete object model for maximum programming flexibility, royalty free end user report designer, barcode report item, excel template export and data merging, and much more. You can download a trial from Data Dynamics (now GrapeCity) and try it with few reports, you will not be disappointed.

Categories

Resources