How to create textbox in Microsoft Reporting Service? - reporting-services

I have create a report in Microsoft Reporting Service that is presented in a browser. I would like to create button that opens a textbox where the user can fill in text. This text should be saved in column in the underlying database.

That cannot be done, Reporting Services is not for that.
But...... if you really really want to do it, it can be done this way:
create a report
in the parameters section have a textbox input like you mention above
define a dataset that calls a stored procedure*, that stored procedure should take the contents of that textbox as a parameter
in the stored procedure you can insert that value into a table
*note that it doesn't have to be a stored proc, that just makes it easier. You could just do it straight in the command text of the dataset.
This tip was only for the brave and the demented. Now refer back to the bit where i said "Reporting Services is not for that". This is a very bad practice, probably worse than using a goto statement, use it carefully.

Related

Run vba code from within 2010 Data Macro

I have a function that creates a text file and need to run it from the data macro. so then the evens can use it on the table.
How do I go about doing this?
You don't, as per our chat. Data macros even run outside of MS Access, if they used code within MS Access, this could not happen. They are tied to the database engine, which knows nothing about Access front-end.
You can run queries from a data macro AFAIK, and it is possible to create a query to write to a file*, but you cannot run VBA.
* I looked into this a little more and I find: "Queries that contain linked tables, action queries, and database references are not allowed in data macros."
You can do this, but it not recommend. Remember, table triggers and store procedure code does run independent of VBA and in fact it runs even if you don't have Access installed.
However, assuming you going to be using Access to always edit the data (a reasonable assumption), then you can in fact have the table macro call VBA code. There are several ways of doing this, but the most common and useful is to set SetLocalVar to a VBA function. This has the added bonus of being able to pass some values to that function which in most cases is likely required.
So, keep in mind you can call VBA code, but then you are adding creating a dependence from your tables to VBA.
So just use SetLocalVar to some dummy var, and place the VBA function in the expression.

MS Reporting Services mark as read checkbox/link

I have report with some messages, and I would like to know is there a way for RS to have checkbox or link which will, when clicked mark message as read, or in other words, inserts/updates isRead column for that id?
Is this even possible?
Is it possible? Yes. Is it easy? Not a easy as most things in SSRS. Will it be elegant? Probably not.
You could create a check box icon which would link back to the report or some other action on the server. This would need to be set to handle a parameter indicating the checkbox clicked. Build a stored proc or other mechanism in the report to catch these clicks and make your column changes.
The biggest problem with this approach would be that, by default, the entire report would need to rerun and reload. You might be able to get something working that keep this smaller, but I'm not sure how.
My advice: don't do it. SSRS isn't designed to support this sort of interactivity with the data source. You'll be fighting against the tool. Look for another interface for this.

How to dynamically embed pdf file to crystal report?

Is there a way to do a dynamic ole insert of a pdf file into a crystal
report based on a value coming from a SQL database?
For example, I have an application in .net, back-ended by a SQL 2008 database.
The app. has a reporting subsystem which uses Crystal Reports to allow
users to run pre-written reports (from stored procedures) by entering
various inputs such as date ranges, etc.
What I want to do is allow the user to enter, say, an account number
which will then be passed to a stored procedure. The procedure will
get the path to the correct PDF file and pass that to a Crystal
Report. How do I get the PDF path to the OLE Object insert??
Is this making any sense??
Thanks for any help in advance.
do you have to use pdf? the idea of adding a pdf to a crystal report makes me feel dirty all over... If possible I would use rpt files as subreports. (note the reason it makes me pale quite so much is that I come from a *nix background and still think pdf should only be used for printing)

Any good GUI tool to easily create stored procs SQL server 2008?

The templates for stored-procs in SSMS do not auto-populate all input columns, again there is manual work involved.
I am looking for something like right-click on table and say CREATE stored-proc, and then it allows to pick a template, based on which it can populate the parameters etc. and give check-box in GUI (like table designer, you can easily add/remove a column).
Some support for change management with table undergoing alter or otherwise would also be helpful.
Currently we manually write all stored-procs, which i think we should be able to save time and labor with automation.
Any suggestion on other free 3rd party tools ?
SSMS tools pack has user configurable templates to generate CRUD stored procedures.
Example template
(source: ssmstoolspack.com)

Dynamic charts at runtime in SSRS

I need to create a report(rdl) in SQL reporting services 2008. In that I need to create in runtime. The report has chart. I will specify the type of chart, font, alignment and all those stuff in runtime.
Is there any option for using this in SSRS 2008.
An rdlc is just an xml file so you can manipulate it at runtime, it's not a trivial undertaking though. You can find the rdl spec at http://download.microsoft.com/download/6/5/7/6575f1c8-4607-48d2-941d-c69622e11c32/RDL_spec_08.pdf.
There's a downloadable example of creating an rdlc for a table and a matrix dynamically, as well as lots of other useful report viewer info at http://www.gotreportviewer.com/.
You can generate the RDL however you want, it is just an XML file. But you will only be able to run the report locally. To run on the server you would need to deploy the report first, as the server does not run the RDL files directly.
I suppose this is still possible, but it would be pretty slow, and the report would not appear in the report manager or anything before hand.
However, your probably making this problem more complicated than it needs to be. I have work on projects where we generated the RDL and deployed daily with a custom application, and it is almost always not worth it. There is usually a better way.
You can set almost all the parameters of the chart using expressions. The only thing that can't be set is the chart type, but there are ways to get around that as well. Like having all the chart types you need created on the page, but making all except the one you want visible.
Yes...
to do so, you will need to either have an existing rdl file to modify, or you need to completely generate it from code.
All the SSRS xml is stored in the database in a table called catalog. You'll have to use the GUID of that report to access it, or insert a new row creating a new report.
once you're done swapping out your report server xml, the report server will have a "new" report that you can then call via your web page, or via SSRS url parameters.
past that clean up the catalog table if you see the need to.
I'll be honest with you though, this is very far from best practice, best practice that I'm aware of would be to embed the data you need to display in your web page in the form of a widget.