Showing posts with label save. Show all posts
Showing posts with label save. Show all posts

Wednesday, March 21, 2012

Projects in SQL Management Studio

I love the template explorer in SQL Management Studio 2005. However, why can't we save these files to a project we've started in Management Studio. I hope in the future that we will be able to change the folder names of projects in Management Studio, and that we will be able to drag template items from the template explorer to our project in the Solution Explorer window.

SQL Project team, can you please add this in the future?

Ron, thanks for your suggestion. I will forward on your comments to my team.

http://connect.microsoft.com is a customer portal where our users can file bugs, vote on their importance, and track their progress throughout our project's lifecycles. You'll be able to connect to the exact member of the team who owns any particular area of SQL Server. Would you mind submitting this idea there and posting a link back to the forum?

Thanks!

Paul A. Mestemaker II
Program Manager
SQL Server
http://blogs.msdn.com/sqlrem/

|||

I have posted this suggestiong and a few other project-related suggestions in a post on connect.microsoft.com. Here's the link:

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=151213

Monday, March 12, 2012

programmaticaly save deployed report in ASP.NET 2.0

Hi

Does somebody knows how to save a remote report on the webserver when the report is generated in a report viewer, all programmaticaly behind the scenes?

So I can view the report later.

Thx

There various approaches to this. Personally I would present the user with some UI for selecting which report they wish to view and submit this to the server using a HTML form. On the server side, check if the requested report exists (depending on how often you wish to recreate the report), if yes then redirect the user to the report, if not then you will need to make a call to the ReportService.Render method requesting HTML as the output format, write the html file to the server and then redirect the user to the newly generated file.

Obviously there are other considerations such as data security, parameters etc.... to consider.

|||

Thx

I have found a solution for the problem by using the Render method as you suggested.
On my localhost it works fine. Only thing to check is if it works on the internet as well.

Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string extension;
string deviceInfo;

deviceInfo = "<DeviceInfo><SimplePageHeaders>True</SimplePageHeaders></DeviceInfo>";

byte[] bytes = rptAfdruk.ServerReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamids, out warnings);

string sPath = Server.MapPath("/timesheet");
FileStream fs = new FileStream(sPath + "/docs/" + sRegId + "/" + sName + ".pdf", FileMode.Create);
fs.Write(bytes, 0, bytes.Length);
fs.Close();

Saturday, February 25, 2012

Programatically query database and save report in an excel table

Hello All,

I am working on constructing a software layer around some features of the RDL language that would allow me to programatically generate reports.

I am reading the RDL specification language, and I do not understand three things:

1) How the DataSet element is populated by the query or more precisely how do the <Field> elements capture all the rows inside the table that is being queries?

To my understanding I wilkl have to define several fields that correspond to all columns of interest in the query.

But that is only for one row (?!) How do the rest of the rows get populated? Does the server recursively create new rows based on my definitions until it matches row for row all the data in the table?

2) Once the elements are inside a DataSet how do make use of that data to render it in a table.

I understand how the DataSource, DataSet, and Table work individually, yet I do not understand how to establish a flow of data between DataSet and Table.

3) Do I even need to use a <Table> as an RDL element in order to organize the data in an excel table?

I would appreciate any help. Thank you!

Anyone?

Monday, February 20, 2012

Programatically Creating Report In PDF Format

My users have a lot of reports that they need to generate and save in PDF
format. Each report is the same, except using different parameters.
What I'd like to do is programatically generate a bunch of PDF report files
to a folder on the network, each one using just a different set of parameters.
I have successfully generated a report using the URL:
http://localhost/reportserver?/Profit%20And%20Loss%20Report&Company=0&JobCode=757375&CustomerGroup=&rs:Command=Render&rs:Format=PDF&rc:OutputFormat=PDF
This pops up a Save As... dialog box, prompting the user for a path and
file name. I'd like to control and set the path file name programatically to
automatically generate all the report permutations by passing different
parameters.
Is the URL method the right approach? Any advice would be appreciated, or at
least point me in the right direction so I can research the actual mechanics
of doing this.
Thanks!!!I think what you want can be accomplished using the Subscription feature of
Reporting Services. You can specify a subscription with the "Report Server
File Share" delivery method in order to save PDFs to a folder on the network
on a specified schedule. You can also set up a shared schedule so all the
subscriptions run at the same time.
- Byron
"Smit-Dog" wrote:
> My users have a lot of reports that they need to generate and save in PDF
> format. Each report is the same, except using different parameters.
> What I'd like to do is programatically generate a bunch of PDF report files
> to a folder on the network, each one using just a different set of parameters.
> I have successfully generated a report using the URL:
> http://localhost/reportserver?/Profit%20And%20Loss%20Report&Company=0&JobCode=757375&CustomerGroup=&rs:Command=Render&rs:Format=PDF&rc:OutputFormat=PDF
> This pops up a Save As... dialog box, prompting the user for a path and
> file name. I'd like to control and set the path file name programatically to
> automatically generate all the report permutations by passing different
> parameters.
> Is the URL method the right approach? Any advice would be appreciated, or at
> least point me in the right direction so I can research the actual mechanics
> of doing this.
> Thanks!!!|||Thanks for the reply Bryon.
The only problem with setup up report subscriptions is that there are about
5 different parameters for the report, and basically I need to cycle through
dozens and dozens of possible parameter values for each parameter. And the
values are database driven, so they will change over time.
I'd like to programatically query the database for a list of valid parameter
values, then loop through the parameters list and generate all the PDF
reports with the proper syntax.
I'm guessing that I can do this from VB or .NET by accessing the SRS web
service interface. I just can't seem to find or understand the documentation
for doing this. Any example code would be great.
Thanks...
"Byron" wrote:
> I think what you want can be accomplished using the Subscription feature of
> Reporting Services. You can specify a subscription with the "Report Server
> File Share" delivery method in order to save PDFs to a folder on the network
> on a specified schedule. You can also set up a shared schedule so all the
> subscriptions run at the same time.
> - Byron
> "Smit-Dog" wrote:
> > My users have a lot of reports that they need to generate and save in PDF
> > format. Each report is the same, except using different parameters.
> >
> > What I'd like to do is programatically generate a bunch of PDF report files
> > to a folder on the network, each one using just a different set of parameters.
> >
> > I have successfully generated a report using the URL:
> >
> > http://localhost/reportserver?/Profit%20And%20Loss%20Report&Company=0&JobCode=757375&CustomerGroup=&rs:Command=Render&rs:Format=PDF&rc:OutputFormat=PDF
> >
> > This pops up a Save As... dialog box, prompting the user for a path and
> > file name. I'd like to control and set the path file name programatically to
> > automatically generate all the report permutations by passing different
> > parameters.
> >
> > Is the URL method the right approach? Any advice would be appreciated, or at
> > least point me in the right direction so I can research the actual mechanics
> > of doing this.
> >
> > Thanks!!!|||programmatically...
you mean something like this? I think this is right.
warnings = rs.CreateReport(asReportName, "/", True,
reportDefinition, Nothing)
If Not (warnings Is Nothing) Then
Dim warning As ReportService.Warning
For Each warning In warnings
lblMsg.Text = warning.Message
Next warning
Else
lblMsg.Text = "Report: {0} created successfully with no
warnings"
End If
result = rs.Render(reportName, "PDF", historyID, devInfo,
parameters, credentials, showHideToggle, encoding, mimeType,
reportHistoryParameters, warnings, streamIDs)
sh.SessionId = rs.SessionHeaderValue.SessionId
lblMsg.Text = "SessionID after call to Render: {0}" &
rs.SessionHeaderValue.SessionId
lblMsg.Text = "Execution date and time: {0}" &
rs.SessionHeaderValue.ExecutionDateTime
lblMsg.Text = "Is new execution: {0}" &
rs.SessionHeaderValue.IsNewExecution
' Write the contents of the report to an pdf file.
Try
' Dim stream As FileStream = File.Create("C:\" &
asReportName & ".pdf", result.Length)
Console.WriteLine("File created.")
stream.Write(result, 0, result.Length)
Console.WriteLine("Result written to the file.")
stream.Close()
Catch ex As Exception
lblMsg.Text = ex.Message
GoTo Exit_Sub
End Try
--
Message posted via http://www.sqlmonster.com

Program to save the blocking on a table

I need save the blocking or deadlock occurrences on a certain table to a
file.
How to write a program (any kind, SQL, Perl, C, Java, etc) to do it? I don't
want to use SQL profiler. I hope a program can do it for me.
Thanks,
LixinHi Lixin,
Thank you for using MSDN Newsgroup! It's my pleasure to assist you with
your issue.
From your description, I understand that you are handling some blocking or
deadlock issues. For monitoring the blocking issue and save it to a file,
you can refer to the following article to use the stored procedure to
collect the blocking information and use Osql utility to output and save
the information to a file:
271509 INF: How to Monitor SQL Server 2000 Blocking
http://support.microsoft.com/?id=271509
For more information, these articles may be also helpful:
283725 INF: How to View SQL Server 2000 Blocking Data
http://support.microsoft.com/?id=283725
283696 INF: Job to Monitor SQL Server 2000 Performance and Activity
http://support.microsoft.com/?id=283696
Best regards,
Billy Yao
Microsoft Online Support
----
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.|||The recommened articles are very helpful. Thanks a lot,
Lixin
""Billy Yao [MSFT]"" <v-binyao@.online.microsoft.com> wrote in message
news:%23aCiUKxuDHA.2520@.cpmsftngxa07.phx.gbl...
> Hi Lixin,
> Thank you for using MSDN Newsgroup! It's my pleasure to assist you with
> your issue.
> From your description, I understand that you are handling some blocking or
> deadlock issues. For monitoring the blocking issue and save it to a file,
> you can refer to the following article to use the stored procedure to
> collect the blocking information and use Osql utility to output and save
> the information to a file:
> 271509 INF: How to Monitor SQL Server 2000 Blocking
> http://support.microsoft.com/?id=271509
> For more information, these articles may be also helpful:
> 283725 INF: How to View SQL Server 2000 Blocking Data
> http://support.microsoft.com/?id=283725
> 283696 INF: Job to Monitor SQL Server 2000 Performance and Activity
> http://support.microsoft.com/?id=283696
>
> Best regards,
> Billy Yao
> Microsoft Online Support
> ----
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
> Please reply to newsgroups only. Thanks.
>