crystal report as website - c#

Ok I am not sure the question I need to ask so I am going to describe what I would like to be able to do I am wondering if this is possible.
I have some paper forms that I am creating webpages for so that the information can be stored in the database using a computer. I have already created one and the user enters the information it is stored in the database then the user has the option to print a crystal report that looks like the paper form with the information entered.
Is it possible to cut out the middle man and have a crystal report as a webpage that the user can hit enter the information into the report and then hit a save control on the page to save it to the database and print from there.
If I am not asking the right question or you need more information please feel free to ask. If it is possible to design the report and then use that on the page make it editable to the client then that would make my life a whole lot easier I just dont know what to look up.

If what you need is to let user fill out a form and the data can save to database, and then the user can access the form, then there are several options:
Use Adobe forms. In this way, you can create pdf forms and you can let people download or email the forms. The forms are fillable, and when they submit the form, all you need is handle it(in forms of xml) at your server side to save it to your database. You could pre-populate data so that when the user download the file and open it, it has some data filled out. The tool you will need to create Adobe forms is Adobe LiveCycle and you have to learn how to use it. Our company use it for some of our web forms because they are secure and can be emailed. Of course you will need to implement server side code to handle it.
Use asp.net web form. You create web form and linked to database. You handle the form data user entered and save them to the database by using ado.net. That give you the most flexibilities.
If you want user open the form they entered in a specific format so that it will looks like a "form", you have two options:
<1> Pass your raw data to a specific css to let user print out in a nicer format instead of just plain text or even the web page. Again, you get flexibilities through this way.
<2> Use SQL Server Report Services(If you use sql server). In this way, you can create print layouts by using visual studio, and then write a stored procedure to get data. If you do this way, the user will also get a pdf file. They can save it or print it.
Hope this helps.

It is possible (assuming you are using a version of SQL which allows you to write stored procedures), but it's a very bad idea:
Write a SQL stored procedure, with a parameter for each field to be entered, that updates the relevant database tables with the appropriate parameter values.
Generate a Crystal report from the stored procedure.
Note that the only functionality available to the data entry fields (lookups, validation, etc.) will be that available to Crystal Report parameters in whichever version of Crystal you are using - generally, this functionailty is minimal.

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

How can I copy HTML textbox values from one domain to another domain's textboxes?

I'm trying to help save time at work with for a lot of tedious copy/paste tasks we have.
So, we have a propitiatory CRM (with proper HTML ID's, etc for accessing elements) and I'd like to copy those vales from the CRM to textboxes on other web pages (outside of the CRM, so sites like Twitter, Facebook, Google, etc)
I'm aware browsers limit this for security and I'm open to anything, it can be a C#/C++ application, Adobe AIR, etc. We only use Firefox at work so even an extension would work. (We do have GreaseMonkey installed so if that's usable too, sweet).
So, any ideas on how to copy values from one web page to another? Ideally, I'm looking to click a button and have it auto-populate fields. If that button has to launch the web pages that need to be copied over to, that's fine.
Example: Copy customers Username from our CRM, paste it in Facebook's Username field when creating a new account.
UPDATE: To answer a user below, the HTML elements on each domain have specific HTML ID's. The data won't need to be manipulated or cleaned up, just a simple copy from ourCRM.com to facebook.com / twitter.com
Ruby Mechanize is a good bet for scraping the data. Then you can store it and post it however you please.
First, I'd suggest that you more clearly define exactly what it is you're looking to do. I read this as you're trying to take some unstructured data from Point A and copy it to Point B. Do the names of these fields remain constant every time you do the operation? Do you need to simply pull any textbox elements from the page and copy them all over? Do some sort of filtering of this data before writing it over?
Once you've got a clear idea of the requirements, if you go the C# route, I'd use something like SimpleBrowser. Judging by the example on their Github page, you could give it the URL of the page you're looking to copy, then name each of the fields you're looking to obtain the value of, perhaps store these in an IDictionary, then open a new URL and copy those values back into the page (and submit the form).
Alternatively, if you don't know the names of the fields, perhaps there's a provided function in that or a similar project that will allow you to simply enumerate all the text fields on the page and retrieve the values for all of them. Then you'd simply apply some logic of your own to filter those options down to whatever is on the destination form.
SO we thought of an easier way to do this (in case anyone else runs into this issue).
1) From our CRM, we added a "Sign up for Facebook" button
2) The button opens a new window with GET variables in the URL
3) Use a greasemonkey script to read those GET variables and fill in textbox values
4) SUCCESS!
Simple, took about 10 minutes to get working. Thanks for you suggestions.

How to set database connection of .rpt dynamically

I don't know how to ask this question thru google, i try but what i've got is not what I want so i decided to post it here.
Currently i'm developing a crystal report for a particular web application. Now i manage to display my report in my development environment, once i deploy the web app and i want to show my report it always display this window.
I don't want to modify those .rpt again to adjust on the current database i want to do it in code, specifically in c sharp. any idea?
If you're hosting the controls yourself -- this post should provide you what you're looking for. If not I'll need you to provide me a bit more information surrounding your solution.
http://social.msdn.microsoft.com/Forums/en-US/vscrystalreports/thread/7345fc6c-9749-42a3-b866-509c57f3cc35/

Using InfoPath for importing and exporting data

The application I'm writing has a need for a solution to the following situation:
Salesman and customer is located offsite. They are finalizing a list of requirements, and will input business data that at some point need to be inputed in the onsite database.
My idea is that the salesperson gets a InfoPath document that is almost completed with default values and heads over to the customer. While at the customer the document is updated to satisfy the customer's need. I must also cover that the document is passed back and forth by email between the salesperson and the customer.
When the salesperson returns to the office he uploads the InfoPath into the database and the order is updated with few user interactions.
Now to the questions:
Is this a workable/sensible solution? Other suggestions to how to solve this?
How do I ensure that form and data stays together when the salesperson takes the document on a USB stick or it's emailed to the customer?
How do I (with C# code) fill a form with default values?
How do I read back the changes?
Sharepoint is not an option.
Some issues that you will need to think about
will customer have infopath installed and therfore may not be able to view the document.
If you email the document or need a customer to view it, generally only the data is transmitted with a pointer to the Form Template. If you want the customer to update it and send it back, then the template will need to be located somewhere publicily accesseable.
The data is stored as an XML document so as part of the startup you could detect that it is a new form set the defaults that you need.
when you publish a form to a networked folder it will also ask for a local path for the form. this allows for a disconected scenarios.
From my experience, InfoPath is a great tool when you have control over the environment. It starts to break down as a viable option once you get outside a controled environment, because you then have to start jumping through hoops to make it work as it should.
EDIT
One you loose control of the environment I think that a web interface would be the way to go.
The sales person could create a new document on the website with the back-end populating all the defaults necessary. A link to the document could be emailed to the customer, who could update their stuff via the web interface and then sales person can then finalise the process.

Crystal 2008 - Can I access the SQL statement programatically at runtime?

We've created a Crystal Report viewer application to house all of our company reports. It's built in such a way that any time we add, modify or delete a report, the viewer application itself does not need to change. The viewer app is completely driven by an XML configure file that tells it what reports are available, where they are, connection information etc. We want to keep it this way too. When we add a new report, we don't want to have to update everyone's viewer application.
The problem is that Crystal talks to our DB directly and we would prefer it didn't. Therefore, for each report, the viewer needs to query the database to retrieve the data each report needs. The problem is that many of our reports allow the user to enter a large number of filter criteria. Ideally, what we would like to be able to do is to have Crystal prompt the user to enter their filter criteria, like it currently does, and then be able to somehow get the SQL statement it would send on to the DB, pass it on to the DB ourselves, and tell Crystal not to. the viewer would then supply the report with data.
Does anyone know if this can be done? An alternative we've considered is to have the viewer prompt the user for the filter criteria, and then build the SQL statement. However, then each report becomes a C# coding project with an update to the viewer. We're trying to avoid that.
Thanks.
Interesting approach. I have only ever done the opposite.
Normally people like to build their own reports using a Crystal client. The report connects to a datasource specified in the report itself.
Using .NET to query the reports needs, set parameters and formulas then view the report is a piece of cake.
Anyway, there are only two methods that I know of called "pull" and "push". Pull is what I just described above. Push is what you described as a solution that you considered but it would involve coding for each report.
I'm afraid what you are trying to do has never been done before. However, I would recommend the "pull" method. It has worked very well for me with a client with dozens of users and hundreds of reports.

Categories

Resources