Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Monday, March 26, 2012

Proper way to rename ASPNETDB.MDF? Custom provider the solution?

ASP.NET 2.0...

What is the proper way to rename the ASPNETDB.MDF to another name, such as TEST_ASPNETDB.MDF?

I know you can rename the db in the IDE, BUT, there are other places you need to change so that ASPNETDB.MDF isn't recreated. Do I have to make a custom SQLExpress provider or something to that effect?

Any examples? Thanks...

Change the connection strings in web.config:

<?xmlversion="1.0"?>

<configuration>

<connectionStrings>

<clear/>

<addname="LocalSqlServer"connectionString="Data Source={Machine name};Initial Catalog=TEST_ASPNETDB;{Rest of connect string here}"providerName="System.Data.SqlClient"/>

</connectionStrings>

Friday, March 23, 2012

Proper ADO Usage where Conflicts will arise

Hi everyone, I'm creating a ASP.NET 2.0 web application utilizing sql server 2000 as a database. My problem revolves around multiuser acces with long running processes. Some of the pages in the application have long running processes against large tables in the database, lets say that take 2minutes to complete. My problem is how do I utilize ado properly in the rest of my application to display a message to users who may try to access data associated with a table while in the midst of one of its long running processes? For instance I would like to notify the user that "Table X is currently locked, please try again in a few minutes".
Do I catch sqlException and examine the .Number property? Any insight is appreciated.

Thanks.

For Sql server 2005 you can use try /catch to Resolve deadlock:Using TRY/CATCH to Resolve Deadlocks in SQL Server 2005

For sql server 2000 you can take a look at:

Tips for Reducing SQL Server Locks

Troubleshooting Deadlocks

Hope it helps.

|||

Sorry I should add that I'm looking for a way to do this WITHOUT stored procedures. My client does not like using stored procedures (regardless of good idea or not), I'm looking for advice on solutions utilizing C# and ADO.NET set of libraries only.

Thanks

sql

Prompting a User ID and Pwd

Hi,
I am developing reports using Reporting Server.With these reports i am
going to run in ASP.Net, but its prompting SQL Server User ID and Password.
Can any one knows the solution for without prompting the User ID and Password.
Is this Possible?
Regards,
Mallihi,
while creating the Data source , in the credentials give
ur sqlserver database username and passwork. and chk the
button allow saving password. then it will not ask u for
any password
>--Original Message--
>Hi,
> I am developing reports using Reporting Server.With
these reports i am
>going to run in ASP.Net, but its prompting SQL Server
User ID and Password.
>Can any one knows the solution for without prompting the
User ID and Password.
>Is this Possible?
>Regards,
>Malli
>
>.
>|||Hi,
I tried as you said, but its not working.whenever i am running the report
in browser it prompts user id and password.can you give me the solution.
Thanking you.
Regards,
Malli.
"anonymous@.discussions.microsoft.com" wrote:
> hi,
> while creating the Data source , in the credentials give
> ur sqlserver database username and passwork. and chk the
> button allow saving password. then it will not ask u for
> any password
> >--Original Message--
> >Hi,
> > I am developing reports using Reporting Server.With
> these reports i am
> >going to run in ASP.Net, but its prompting SQL Server
> User ID and Password.
> >Can any one knows the solution for without prompting the
> User ID and Password.
> >
> >Is this Possible?
> >
> >Regards,
> >Malli
> >
> >
> >
> >.
> >
>

Prompt password when calling certain reports only?

Hi,

When I call certain reports from an ASP application, some prompt for password and some are not.

I wonder why is this happen?

Under the Directory Security of Reports under IIS 6, I already enable Anonymous Access for IUSR_XXXX with the correct password.

I also assign IUSR_XXXX as Browser in Report Manager of Reporting Services.

The enviroment is Windows Server 2003 standard edition, IIS 6, SQL Server 2005.

Thanks in advance.

Best regards,

Pop

You can check the data source settings for the reports. There is an option to prompt for password for the datasources of reports.|||

I had try

1)"Use Windows Authentication"

2)"Use a specific user name and password"

3)"No credentials"

in Data source setting and non of it works.

When I try with option 1 and 2, only one of the reports prompt for password(so far that's what I discover, only 1 report prompt for password), the rest no need.

Any clue?

Best regards,

Pop

Monday, March 12, 2012

Programming Subscription Options

Hello,
We are developing our own ASP.NET 2.0 (C#) front-end for Reporting Services. We are trying to create an interface for setting up standard subscriptions that is similar to Report Manager.

On Report Manager's Report Server File Share options page, there are two options Render Format and Overwrite options that we need help with. Can we query the ReportServer and get the available Render Formats to populate a dropdownlist? Or, do we have to hard-code the values?

Same for the Overwrite options, are these hard-coded? Or, can the valid values be retreived from ReportServer?

Finally, on the Report Server E-mail setup page, there is a Priority field that we need to replicate. Again, are the valid values hard-coded into the dropdownlist or retreived from the ReportServer?

Thanks.I answered this in the newsgroup but will post my answer here as well.

You can call GetExtensionSettings to get the settings that a delivery
extension accepts. The extensions will return a populated list of renders
that it supports as well as the full set of options that it supports.

Programming Subscription Options

Hello,
We are developing our own ASP.NET 2.0 (C#) front-end for Reporting Services.
We are trying to create an interface for setting up standard subscriptions
that is similar to Report Manager.
On Report Manager's Report Server File Share options page, there are two
options Render Format and Overwrite options that we need help with. Can we
query the ReportServer and get the available Render Formats to populate a
dropdownlist? Or, do we have to hard-code the values?
Same for the Overwrite options, are these hard-coded? Or, can the valid
values be retrieved from ReportServer?
Finally, on the Report Server E-mail setup page, there is a Priority field
that we need to replicate. Again, are the valid values hard-coded into the
dropdownlist or retrieved from the ReportServer?
Thanks.You can call GetExtensionSettings to get the settings that a delivery
extension accepts. The extensions will return a populated list of renders
that it supports as well as the full set of options that it supports.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"sam" <nospam@.company.com> wrote in message
news:uDhn8VD$FHA.140@.TK2MSFTNGP12.phx.gbl...
> Hello,
> We are developing our own ASP.NET 2.0 (C#) front-end for Reporting
> Services.
> We are trying to create an interface for setting up standard subscriptions
> that is similar to Report Manager.
> On Report Manager's Report Server File Share options page, there are two
> options Render Format and Overwrite options that we need help with. Can
> we
> query the ReportServer and get the available Render Formats to populate a
> dropdownlist? Or, do we have to hard-code the values?
> Same for the Overwrite options, are these hard-coded? Or, can the valid
> values be retrieved from ReportServer?
> Finally, on the Report Server E-mail setup page, there is a Priority field
> that we need to replicate. Again, are the valid values hard-coded into
> the
> dropdownlist or retrieved from the ReportServer?
> Thanks.
>|||Thanks Daniel!
Another quick question for you...
How does Report Manager validate that the Path is in Uniform Naming
Convention (UNC) format? More than likely, our end users will enter
something like: D:\Product\Reports, and I guess we'll need to validate it.
"Daniel Reib [MSFT]" <danreib@.online.microsoft.com> wrote in message
news:%23wXU5iE$FHA.216@.TK2MSFTNGP15.phx.gbl...
> You can call GetExtensionSettings to get the settings that a delivery
> extension accepts. The extensions will return a populated list of renders
> that it supports as well as the full set of options that it supports.
> --
> -Daniel
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "sam" <nospam@.company.com> wrote in message
> news:uDhn8VD$FHA.140@.TK2MSFTNGP12.phx.gbl...
> > Hello,
> > We are developing our own ASP.NET 2.0 (C#) front-end for Reporting
> > Services.
> > We are trying to create an interface for setting up standard
subscriptions
> > that is similar to Report Manager.
> >
> > On Report Manager's Report Server File Share options page, there are two
> > options Render Format and Overwrite options that we need help with. Can
> > we
> > query the ReportServer and get the available Render Formats to populate
a
> > dropdownlist? Or, do we have to hard-code the values?
> >
> > Same for the Overwrite options, are these hard-coded? Or, can the valid
> > values be retrieved from ReportServer?
> >
> > Finally, on the Report Server E-mail setup page, there is a Priority
field
> > that we need to replicate. Again, are the valid values hard-coded into
> > the
> > dropdownlist or retrieved from the ReportServer?
> >
> > Thanks.
> >
> >
>|||We don't validate all UNC paths, I believe it just checks that it starts
with \\
No real magic. :)
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"sam" <nospam@.company.com> wrote in message
news:%236XyizE$FHA.1312@.TK2MSFTNGP09.phx.gbl...
> Thanks Daniel!
> Another quick question for you...
> How does Report Manager validate that the Path is in Uniform Naming
> Convention (UNC) format? More than likely, our end users will enter
> something like: D:\Product\Reports, and I guess we'll need to validate it.
>
> "Daniel Reib [MSFT]" <danreib@.online.microsoft.com> wrote in message
> news:%23wXU5iE$FHA.216@.TK2MSFTNGP15.phx.gbl...
>> You can call GetExtensionSettings to get the settings that a delivery
>> extension accepts. The extensions will return a populated list of
>> renders
>> that it supports as well as the full set of options that it supports.
>> --
>> -Daniel
>> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>>
>> "sam" <nospam@.company.com> wrote in message
>> news:uDhn8VD$FHA.140@.TK2MSFTNGP12.phx.gbl...
>> > Hello,
>> > We are developing our own ASP.NET 2.0 (C#) front-end for Reporting
>> > Services.
>> > We are trying to create an interface for setting up standard
> subscriptions
>> > that is similar to Report Manager.
>> >
>> > On Report Manager's Report Server File Share options page, there are
>> > two
>> > options Render Format and Overwrite options that we need help with.
>> > Can
>> > we
>> > query the ReportServer and get the available Render Formats to populate
> a
>> > dropdownlist? Or, do we have to hard-code the values?
>> >
>> > Same for the Overwrite options, are these hard-coded? Or, can the
>> > valid
>> > values be retrieved from ReportServer?
>> >
>> > Finally, on the Report Server E-mail setup page, there is a Priority
> field
>> > that we need to replicate. Again, are the valid values hard-coded into
>> > the
>> > dropdownlist or retrieved from the ReportServer?
>> >
>> > Thanks.
>> >
>> >
>>
>

Programmatically Saving As PDF?

Ok. So I have this ASP.NET page and I've programmatically taken a report from the report server and rendered it in PDF. Now I would like to take this a step further and save the report as a pdf document on the local machine.

So at this point I have a byte array representing the document, now how would I save this as a pdf on the local machine? I'm unaware of an ASP Response method to allow this and I'm unaware of a SSRS ReportingService method, but as I said I'm unaware...

Any ideas, thoughts, resources are all welcome.

Well, the answer was actually quite easy to implement as the code below shows...

using (FileStream stream = File.OpenWrite(resultByte))

{

stream.Write(resultByte, 0, resultByte.length);

}

For those that may be interested in the full implementation then check out this article at http://www.codeproject.com/sqlrs/PDFUsingSQLRepServices.asp?df=100.

Wednesday, March 7, 2012

Programmatically change a textbox's contents

Quick question... I have a C# ASP.Net (2.0) webpage with a ReportViewer
control on it. In the code-behind I set the datasource of the report and
then view the report data:
DataSet ds = DBProvider.GetDataSet(SQL, DateFrom, DateTo);
rvRR310.LocalReport.ReportPath = "RR310.rdlc";
rvRR310.LocalReport.DataSources.Clear();
rvRR310.LocalReport.DataSources.Add(new
ReportDataSource("Reports_stp_RR310_Export", ds.Tables[0]));
"DBProvider" is a class I made to talk to the SQL Server and "RR310.rdlc" is
the actual report itself. The query that is executed accepts a couple
parameters (start date and end date) for the data that is to be returned.
My issue is not with this part, as everything up to this point works great.
What I am trying to figure out how to do is access the report itself, so I
can change the contents of a textbox I put there. I want to take the query
parameters and stuff them into the report textbox so I can have it say
something like "Date Range: <start> to <end>". The problem is I can't
figure out how to write the code to allow me to do this.
Anyone have a suggestion or pointer? Thanks!
-- AndrewOn May 23, 5:10 pm, "Andrew" <andrewr2k1@.n0r3ply_hotmail.com> wrote:
> Quick question... I have a C# ASP.Net (2.0) webpage with a ReportViewer
> control on it. In the code-behind I set the datasource of the report and
> then view the report data:
> DataSet ds = DBProvider.GetDataSet(SQL, DateFrom, DateTo);
> rvRR310.LocalReport.ReportPath = "RR310.rdlc";
> rvRR310.LocalReport.DataSources.Clear();
> rvRR310.LocalReport.DataSources.Add(new
> ReportDataSource("Reports_stp_RR310_Export", ds.Tables[0]));
> "DBProvider" is a class I made to talk to the SQL Server and "RR310.rdlc" is
> the actual report itself. The query that is executed accepts a couple
> parameters (start date and end date) for the data that is to be returned.
> My issue is not with this part, as everything up to this point works great.
> What I am trying to figure out how to do is access the report itself, so I
> can change the contents of a textbox I put there. I want to take the query
> parameters and stuff them into the report textbox so I can have it say
> something like "Date Range: <start> to <end>". The problem is I can't
> figure out how to write the code to allow me to do this.
> Anyone have a suggestion or pointer? Thanks!
> -- Andrew
If I understand you correctly, you should be able to achieve this by
referencing the report parameters. Something like this should work as
expressions in the textbox controls in the report itself.
=Parameters!StartDate.Value
=Parameters!EndDate.Value
Regards,
Enrique Martinez
Sr. Software Consultant|||I would agree with you if the report knew about the parameters, but the
report never sees them. As shown in the code snippet, I pass the SQL stored
procedure, and the arguments, to a method of my class that talks to the SQL
Server. It passes back a dataset which I then assign to the report. The
report only knows about the data, not any parameters.
Let me ask the question another way...
From the .cs page that has the ReportViewer control, how can I change the
text of a TextBox inside the report. Never mind where or what the content
is coming from, just, how do I change the text from outside the report
itself and at runtime?
"EMartinez" <emartinez.pr1@.gmail.com> wrote in message
news:1179970516.364360.86270@.m36g2000hse.googlegroups.com...
> On May 23, 5:10 pm, "Andrew" <andrewr2k1@.n0r3ply_hotmail.com> wrote:
>
> If I understand you correctly, you should be able to achieve this by
> referencing the report parameters. Something like this should work as
> expressions in the textbox controls in the report itself.
> =Parameters!StartDate.Value
> =Parameters!EndDate.Value
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||I found the answer to my question....
First step is to set up a Report Parameter (as many as you need for whatever
it is you need to do).
Second, add a TextBox to the report, and then under Expressions, set it to
display the Parameter you desire.
Last, in the .cs page that loads the ReportViewer control, add the following
code:
ReportParameter[] params = new ReportParameter[2];
params[0] = new ReportParameter("DateFrom", "ProductShipped", false);
params[1] = new ReportParameter("DateTo", "@.parameter1", false);
this.reportViewer.LocalReport.SetParameters(params);
Of course, change the names and size to suit your needs.
Pretty simple and straightforward, and works very nicely with what I wanted
to do.
-- Andrew
"Andrew" <andrewr2k1@.n0r3ply_hotmail.com> wrote in message
news:e413UcYnHHA.4476@.TK2MSFTNGP02.phx.gbl...
> Quick question... I have a C# ASP.Net (2.0) webpage with a ReportViewer
> control on it. In the code-behind I set the datasource of the report and
> then view the report data:
> DataSet ds = DBProvider.GetDataSet(SQL, DateFrom, DateTo);
> rvRR310.LocalReport.ReportPath = "RR310.rdlc";
> rvRR310.LocalReport.DataSources.Clear();
> rvRR310.LocalReport.DataSources.Add(new
> ReportDataSource("Reports_stp_RR310_Export", ds.Tables[0]));
> "DBProvider" is a class I made to talk to the SQL Server and "RR310.rdlc"
> is the actual report itself. The query that is executed accepts a couple
> parameters (start date and end date) for the data that is to be returned.
> My issue is not with this part, as everything up to this point works
> great. What I am trying to figure out how to do is access the report
> itself, so I can change the contents of a textbox I put there. I want to
> take the query parameters and stuff them into the report textbox so I can
> have it say something like "Date Range: <start> to <end>". The problem is
> I can't figure out how to write the code to allow me to do this.
> Anyone have a suggestion or pointer? Thanks!
> -- Andrew
>

Monday, February 20, 2012

Programatically deploying reports

Hi All,

I want to programatically deploy the report in VS2005 environment,ie.from an asp.net page if i click deploy report Button ,the report should be deployed into the report server automatically.So that i can view the report in report server.
the input to the asp page would be the.rdl file...
If anyone could help then it would be good.

thankyou.


See the sample here:

http://www.codeproject.com/sqlrs/SQLReportDeploy.asp

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Jens,

Thanks for the link! I posted a similar question twice in the past couple of weeks without a response and now I have one!

|||I was tired watching the Reporting Services groups, but now I am planning to visit it more regulary. :-)

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Another way of doing this can be found out at

http://sqlblog.com/blogs/rhundhausen/archive/2006/12/26/deploy-rdl-files-to-multiple-sql-server-2005-reporting-services-servers.aspx

check it out this really works.