Showing posts with label aspx. Show all posts
Showing posts with label aspx. Show all posts

Monday, March 19, 2012

Dynamically generating RDL

I would like to point my Report Server to an ASPX page that outputs RDL.
Can this be done? Any examples or tutorials that anyone can point me to?
Thanks!
-mdbNot very easily. RS is a server based product. You have to deploy the RDL to
the server. BUT, with VS 2005 you have two new controls that have a local
mode, no server required. You can give the control your RDL (for these
controls it will be a RDLC file). It has to be RS 2005 format. These
controls come with VS, not SQL Server.
I really recommend checking out the controls. If generating RDL these
controls will make it much much much easier.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Michael Bray" <mbray@.makeDIntoDot_ctiusaDcom> wrote in message
news:Xns9746A0025EBA5mbrayctiusacom@.207.46.248.16...
>I would like to point my Report Server to an ASPX page that outputs RDL.
> Can this be done? Any examples or tutorials that anyone can point me to?
> Thanks!
> -mdb

Sunday, March 11, 2012

Dynamically Creating Columns

I have an .aspx page where users can select columns from a table. I want to pass the Select statement to a SQL Reporting Services report, probably as a stored procedure, and open the report with the records for the columns selected as an Excel file. My problem is that I am not sure how to dynamically create the column headings and values in a table. Any thoughts on how to achieve this? Thanks!

HI,amiejoye:

When do you want to dynamically create the column heading? In report data retrieving or other period?

|||

if you want to dynamically add headers then you can use code section in reporting service.

Else you can use drag and drop the fileds(clumn name ) that is comin from the dataset

|||

I want to create the column headings and retrieve the records when I click Submit from the .aspx page. Basically, when I click Submit, that's how I want the age to open, with the data from the Select statement I created.

|||

I think that should not be aproblem because the vb code section in the reporting service depends on the select query only

Sunday, February 26, 2012

Dynamic Update System

Hello folks!

I'm have some trouble with a dynamic update system! What I want to do:

1. I want to send in the code behind from any .aspx file values and parameters to a .vb class

2. Code (code behind in .aspx file):

1 gridupdate.updategrid("tblFeedbackA", e.CommandArgument,"locked=@.locked","@.locked","int","0") 'Call de .vb class
2 getgridfeedback()

3. Code (code in .vb class)

1Public Shared Function updategrid(ByVal tblnaamAs String,ByVal xAs Integer,ByVal sqlAs String,ByVal parametersAs String,ByVal sqltypeAs String,ByVal waardenAs String 'translation: values)2Dim dynstrAs String()3Dim dynstr2As String()4Dim reAs New Regex(",")5 dynstr = re.Split(parameters)6Dim iAs Integer7 dynstr2 = re.Split(sqltype)8Dim dynstr3As String()9 dynstr3 = re.Split(waarden)1011Dim sqlconnAs New SqlConnection(ConfigurationManager.ConnectionStrings("DataBase").ConnectionString)12Dim sql2As String ="UPDATE " & HttpContext.Current.Session("prefix").ToString & tblnaam &" set " & sql &" where id=" & x13Dim sqlcmdAs New SqlCommand(sql2, sqlconn)14 sqlconn.Open()1516For i = 0To dynstr.Length - 117 sqlcmd.Parameters.Add(dynstr(i),CType("sqldbtype." & dynstr2(i), System.Data.SqlDbType))18 sqlcmd.Parameters(dynstr(i)).Value = dynstr3(i)19Next20 sqlcmd.ExecuteNonQuery()21 sqlconn.Close()22Return Nothing23 End Function
All I want to do is to add the sqlparameters dynamically, but I don't find a way to do this :).

Can you help me out?

Thanks!

Hi Bert,

You are real close. You are trying to parse in a command string dynamically which usually wont work. A better way to do it, is to add paramaters to the sqlcommand method.

Rather than trying to parse a string together, do something like

sql2 = "UPDATE @.Parm1 SET @.Parm2 WHERE ID=@.Parm3"

sqlCmd.Paramaters.Addwithvalue("@.Parm1", HttpContext.Current.Session("prefix").ToString & tblnaam)

sqlCmd.Parmaters.addwithvalue("@.Parm2", sql)

sqlCmd.Parmaters.addwithvalue("@.parm3", x)

Sqlcmd.ExecuteNonQuery()

etc...

Give that a shot, see if it works for what you are trying to do.