Thursday, March 29, 2012
Automating Reporting Services in my Windows App.
app?
I want to be able to pick up events when the user right-clicks on the report
etc.
I really want to provide a context menu with options relevant to what
they've selected in the report.
As I understood it, the generated report is basically html and theres no
easy way of doing it...
I basically want the report to be more dynamic than just being generated and
then printed.
If not is in coming in a future version of SQL Server?Are you using the ReportViewer control?
http://gotreportviewer.com/
If on the server you may be able to add via .css?
http://weblogs.asp.net/jgalloway/archive/2006/09/01/SQL-Reporting-Services-_2D00_-CSS-fix-for-Firefox.aspx
Steve MunLeeuw
"James" <James@.discussions.microsoft.com> wrote in message
news:E1244EC6-5372-4AB2-8BC1-9D41827F2D8E@.microsoft.com...
> Is there a way of automating SQL Server Reporting Services reports in my
> win
> app?
> I want to be able to pick up events when the user right-clicks on the
> report
> etc.
> I really want to provide a context menu with options relevant to what
> they've selected in the report.
> As I understood it, the generated report is basically html and theres no
> easy way of doing it...
> I basically want the report to be more dynamic than just being generated
> and
> then printed.
> If not is in coming in a future version of SQL Server?|||yes, I'm currently looking into doing it via hyperlinks as in the following
article:
http://www.devx.com/dotnet/Article/30424/0/page/6
"Steve MunLeeuw" wrote:
> Are you using the ReportViewer control?
> http://gotreportviewer.com/
> If on the server you may be able to add via .css?
> http://weblogs.asp.net/jgalloway/archive/2006/09/01/SQL-Reporting-Services-_2D00_-CSS-fix-for-Firefox.aspx
> Steve MunLeeuw
> "James" <James@.discussions.microsoft.com> wrote in message
> news:E1244EC6-5372-4AB2-8BC1-9D41827F2D8E@.microsoft.com...
> > Is there a way of automating SQL Server Reporting Services reports in my
> > win
> > app?
> > I want to be able to pick up events when the user right-clicks on the
> > report
> > etc.
> > I really want to provide a context menu with options relevant to what
> > they've selected in the report.
> > As I understood it, the generated report is basically html and theres no
> > easy way of doing it...
> > I basically want the report to be more dynamic than just being generated
> > and
> > then printed.
> >
> > If not is in coming in a future version of SQL Server?
>
>sql
Tuesday, March 27, 2012
Automating copy between 3 servers
Development occurs on 3 DBs:
- Office DB - (MS SQL server 2000)
- Customer DB - (MS SQL server 2000)
- Portable DB - (MSDE 2000)
Since moving continuosly, as a daily routine I have to copy the latest DB,
and currently I use Enterprise manager to do so (backup/restore); boring,
'cause db paths are different on the 3 machines hosting the db servers.
Is there an easy way to automate the exchange between the 3 servers?
if all of your data is moving only in one direction and all of your tables have PK's on them, think about transactional replication.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
sql
Automating Bkp & restore from command line
Databases:
1 - Production: MS SQL 2000 server
2 - Test: MS SQL 2000 server
3 - Test: MSDE
As I'm modifyng extensively db structure I have to manually move modified
dbs between the 3 servers daily. multiple times, and got bored to manually
select each time paths and options (overwrite, force restore, devices etc)
So I wrote a small script in QA and thought if possible to runnit from
commandline (OSQL would do the job?). But I still miss a statement to
specifiy to wich DB the script must connect before doing th rest:
Here's my code and I've got a trutsed connection, so y would run:
osql -q "Restore.sql" -E:
The script contains:
USE MASTER
GO
RESTORE DATABASE Test
FROM DISK = 'C:\test.BAK'
WITH REPLACE,
MOVE 'Test_Log' TO 'C:\DBMS\Microsoft SQL Server 2000\MSSQL\Data\test.LDF',
MOVE 'Test_dat' TO 'C:\DBMS\Microsoft SQL Server 2000\MSSQL\Data\test.MDF'
What am I missing to connect to the prper server?
Thanks
You first say:
> But I still miss a statement to
> specifiy to wich DB the script must connect before doing th rest:
And then:
> What am I missing to connect to the proper server?
Which one is it? Database or server? To specify a server, you use the -S switch for OSQL. The db is a bit more
problematic as it is included in the RESTORE command, but my guess is that it is server you are after.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Atlas" <atlaspeak@.my-deja.com> wrote in message news:CMJuc.17145$G%.462@.tornado.fastwebnet.it...
> Currently developing a small app (Access) I'm using the same app on 3 SQL
> Databases:
> 1 - Production: MS SQL 2000 server
> 2 - Test: MS SQL 2000 server
> 3 - Test: MSDE
> As I'm modifyng extensively db structure I have to manually move modified
> dbs between the 3 servers daily. multiple times, and got bored to manually
> select each time paths and options (overwrite, force restore, devices etc)
> So I wrote a small script in QA and thought if possible to runnit from
> commandline (OSQL would do the job?). But I still miss a statement to
> specifiy to wich DB the script must connect before doing th rest:
> Here's my code and I've got a trutsed connection, so y would run:
> osql -q "Restore.sql" -E:
> The script contains:
> USE MASTER
> GO
> RESTORE DATABASE Test
> FROM DISK = 'C:\test.BAK'
> WITH REPLACE,
> MOVE 'Test_Log' TO 'C:\DBMS\Microsoft SQL Server 2000\MSSQL\Data\test.LDF',
> MOVE 'Test_dat' TO 'C:\DBMS\Microsoft SQL Server 2000\MSSQL\Data\test.MDF'
>
> What am I missing to connect to the prper server?
> Thanks
>
|||osql -S [servername] ?
Peter Yeoh
http://www.yohz.com
Need smaller backups? Try MiniSQLBackup
"Atlas" <atlaspeak@.my-deja.com> wrote in message
news:CMJuc.17145$G%.462@.tornado.fastwebnet.it...
> Currently developing a small app (Access) I'm using the same app on 3 SQL
> Databases:
> 1 - Production: MS SQL 2000 server
> 2 - Test: MS SQL 2000 server
> 3 - Test: MSDE
> As I'm modifyng extensively db structure I have to manually move modified
> dbs between the 3 servers daily. multiple times, and got bored to manually
> select each time paths and options (overwrite, force restore, devices etc)
> So I wrote a small script in QA and thought if possible to runnit from
> commandline (OSQL would do the job?). But I still miss a statement to
> specifiy to wich DB the script must connect before doing th rest:
> Here's my code and I've got a trutsed connection, so y would run:
> osql -q "Restore.sql" -E:
> The script contains:
> USE MASTER
> GO
> RESTORE DATABASE Test
> FROM DISK = 'C:\test.BAK'
> WITH REPLACE,
> MOVE 'Test_Log' TO 'C:\DBMS\Microsoft SQL Server
2000\MSSQL\Data\test.LDF',
> MOVE 'Test_dat' TO 'C:\DBMS\Microsoft SQL Server 2000\MSSQL\Data\test.MDF'
>
> What am I missing to connect to the prper server?
> Thanks
>
|||Hi,
OSQL -S Server_name -E -i c:\Restore.sql -oc:\restore.log
Note: -q option is to give the query in the OSQL itself. Use iption "i" to
input a file.
Thanks
Hari
MCDBA
"Atlas" <atlaspeak@.my-deja.com> wrote in message
news:CMJuc.17145$G%.462@.tornado.fastwebnet.it...
> Currently developing a small app (Access) I'm using the same app on 3 SQL
> Databases:
> 1 - Production: MS SQL 2000 server
> 2 - Test: MS SQL 2000 server
> 3 - Test: MSDE
> As I'm modifyng extensively db structure I have to manually move modified
> dbs between the 3 servers daily. multiple times, and got bored to manually
> select each time paths and options (overwrite, force restore, devices etc)
> So I wrote a small script in QA and thought if possible to runnit from
> commandline (OSQL would do the job?). But I still miss a statement to
> specifiy to wich DB the script must connect before doing th rest:
> Here's my code and I've got a trutsed connection, so y would run:
> osql -q "Restore.sql" -E:
> The script contains:
> USE MASTER
> GO
> RESTORE DATABASE Test
> FROM DISK = 'C:\test.BAK'
> WITH REPLACE,
> MOVE 'Test_Log' TO 'C:\DBMS\Microsoft SQL Server
2000\MSSQL\Data\test.LDF',
> MOVE 'Test_dat' TO 'C:\DBMS\Microsoft SQL Server 2000\MSSQL\Data\test.MDF'
>
> What am I missing to connect to the prper server?
> Thanks
>
Thursday, March 22, 2012
automatically copy database to another pc
When I create a setup program for my vb.net 1.0 app which has embedded sql express database, it successfully copies the database to the new machine alone with the upgraded app.
However, if I just copy the vb.exe app to the other pc and also copy the mdf, ldf files, I get an error opening the sql database.
I am presuming that the setup program does some kind of backup restore or detach, attach to copy in the .mdf.
If the user cannot do this from the management studio (or if they do not have the management studio installed), is there any way I can create some method to have this copying done automatically via some code by the user?
Thanks
SM Haig
Yes, you can run a restore script using the sqlcmd program. You can read more about the restore command here:
http://msdn2.microsoft.com/en-us/library/ms186858.aspx
Buck Woody
Monday, March 19, 2012
Automatic printing from ReportViewer control
I've got a WinForm app written in .NET 2.0 (C#). We have a series of SQL
Reporting Services reports which are on a remote server - not RDLCs. I've
got a ReportViewer control on one of the forms, and am able to render the
reports in the ReportViewer just fine. However, I would like to be able to
print these reports, preferably without displaying any UI at all, through
this app. Does anybody have any suggestions? I realize that RDLCs would
work in this case, but that's not an option, unfortunately.
Thanks, JimOn Jan 4, 6:34 pm, "LiveCycle" <livecy...@.sandbox.etech.adobe.com>
wrote:
> Hi,
> I've got a WinForm app written in .NET 2.0 (C#). We have a series of SQL
> Reporting Services reports which are on a remote server - not RDLCs. I've
> got a ReportViewer control on one of the forms, and am able to render the
> reports in the ReportViewer just fine. However, I would like to be able to
> print these reports, preferably without displaying any UI at all, through
> this app. Does anybody have any suggestions? I realize that RDLCs would
> work in this case, but that's not an option, unfortunately.
> Thanks, Jim
This link should be helpful.
http://forums.asp.net/p/516455/533549.aspx
Regards,
Enrique Martinez
Sr. Software Consultant
Thursday, March 8, 2012
Automated Printing of Report
app. The only thing I have been able to figure out so far is displaying the
report in a browser. Is there a way to programmatically send my report to
the printer without viewing in browser first.
I would like it to print just as it does when I preview and print from the
designer.
--
Don
--
DonHmm, the only way to print from anywhere (designer or otherwise) is to
export to another format (like PDF) and print. Printing in any other way
just prints the currently showing page. Render as PDF and print that. You
could use web services to render as PDF, save the file and then print it.
Note that with SP2 there will be client supported printing (Yeah!). Don't
know when SP2 will be.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Don" <Don@.discussions.microsoft.com> wrote in message
news:8C7AC7D1-F4CF-4EF1-BCF4-170D7610A9DF@.microsoft.com...
> I have a report that I want to print. This report is invoked from a
windows
> app. The only thing I have been able to figure out so far is displaying
the
> report in a browser. Is there a way to programmatically send my report to
> the printer without viewing in browser first.
> I would like it to print just as it does when I preview and print from the
> designer.
> --
> Don
> --
> Don|||you can print from the designer by clicking on the Preview tab and just to
the right of the page number range buttons and the refresh button there is a
print preview icon, click it and the print icon will be enabled. you can
print it from there.
"Bruce L-C [MVP]" wrote:
> Hmm, the only way to print from anywhere (designer or otherwise) is to
> export to another format (like PDF) and print. Printing in any other way
> just prints the currently showing page. Render as PDF and print that. You
> could use web services to render as PDF, save the file and then print it.
> Note that with SP2 there will be client supported printing (Yeah!). Don't
> know when SP2 will be.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Don" <Don@.discussions.microsoft.com> wrote in message
> news:8C7AC7D1-F4CF-4EF1-BCF4-170D7610A9DF@.microsoft.com...
> > I have a report that I want to print. This report is invoked from a
> windows
> > app. The only thing I have been able to figure out so far is displaying
> the
> > report in a browser. Is there a way to programmatically send my report to
> > the printer without viewing in browser first.
> >
> > I would like it to print just as it does when I preview and print from the
> > designer.
> >
> > --
> > Don
> > --
> > Don
>
>|||How about that, I've never paid attention to that. I guess since there was
no printing from deployed reports I've never paid attention to it. That's a
little embarassing. I decided to see what it did and at least for me the
print preview is totally flaky. Nothing shows, I click the print button
after the preview and then the preview shows up. I click the print button
after the print preview and cancel it and I see part of the page.
Behind the scenes it must be doing the same thing that you could do. I am
guessing that it is rendering it in pdf and showing in the embedded browser
control and then telling it to print.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Don" <Don@.discussions.microsoft.com> wrote in message
news:78D74B64-F4C7-47C9-863E-6D905AE1A3F1@.microsoft.com...
> you can print from the designer by clicking on the Preview tab and just to
> the right of the page number range buttons and the refresh button there is
a
> print preview icon, click it and the print icon will be enabled. you can
> print it from there.
> "Bruce L-C [MVP]" wrote:
> > Hmm, the only way to print from anywhere (designer or otherwise) is to
> > export to another format (like PDF) and print. Printing in any other way
> > just prints the currently showing page. Render as PDF and print that.
You
> > could use web services to render as PDF, save the file and then print
it.
> >
> > Note that with SP2 there will be client supported printing (Yeah!).
Don't
> > know when SP2 will be.
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "Don" <Don@.discussions.microsoft.com> wrote in message
> > news:8C7AC7D1-F4CF-4EF1-BCF4-170D7610A9DF@.microsoft.com...
> > > I have a report that I want to print. This report is invoked from a
> > windows
> > > app. The only thing I have been able to figure out so far is
displaying
> > the
> > > report in a browser. Is there a way to programmatically send my
report to
> > > the printer without viewing in browser first.
> > >
> > > I would like it to print just as it does when I preview and print from
the
> > > designer.
> > >
> > > --
> > > Don
> > > --
> > > Don
> >
> >
> >|||Have you tried installing and using the sample print delivery extension? Look
in the samples section of the Reporting Services Books Online for how to
install it. I believe it is just a sample which therefore is not supported,
and I have never used it myself.
Charles Kangai, MCT, MCDBA
"Don" wrote:
> I have a report that I want to print. This report is invoked from a windows
> app. The only thing I have been able to figure out so far is displaying the
> report in a browser. Is there a way to programmatically send my report to
> the printer without viewing in browser first.
> I would like it to print just as it does when I preview and print from the
> designer.
> --
> Don
> --
> Don|||If you use DebugLocal configuration mode and 'Run' the report, it comes
up with a specialised viewer with a print button. I believe this uses
the RS.exe command line utility - but I don't know how!
Maybe you could utilise this somehow?
Also the following link in BOL shows you how to develop your own
renderer (if you're so inclined!);
ms-help://MS.RSBOL80.1033/RSAMPLES/htm/rss_sampleapps_v1_0q28.htm
Regards
Chris
Bruce L-C [MVP] wrote:
> How about that, I've never paid attention to that. I guess since
> there was no printing from deployed reports I've never paid attention
> to it. That's a little embarassing. I decided to see what it did and
> at least for me the print preview is totally flaky. Nothing shows, I
> click the print button after the preview and then the preview shows
> up. I click the print button after the print preview and cancel it
> and I see part of the page.
> Behind the scenes it must be doing the same thing that you could do.
> I am guessing that it is rendering it in pdf and showing in the
> embedded browser control and then telling it to print.
Automated client report rendering
certain reports. Is there a .NET client report rendering library that
is not dependent on IIS (as the SOAP/URL apis are), nor WinForms (as
the ReportViewer is)?
Thanks,
EvaAfter some research I've found one third-party product called the RDL
Project that renders RDL into HTML, PDF, and some other formats. It's
found at http://www.fyiReporting.com. I played with it, and its version
1.0.1 can't yet parse a report that I built in VS2005, although I think
it could if I removed a few unsupported things from the report and if I
studied its code a bit more (documentation seems lacking).
Hope this post helps someone else, and of course if you know of any
other options please let me know!
Friday, February 24, 2012
autogrow of log file possibly cause timeout?
i had a problem with a server instance where an app processing a file and putting the data into the database using a stored procedure was timing out. the app is a service and in the case of errors, will try to process the file until it has been succesfully added data to the database. in the event viewer i keep seeing this message during this timeout period:
"Autogrow of file 'mydatabase_log' in database 'mydatabase' was cancelled by user or timed out after 15687 milliseconds. Use ALTER DATABASE to set a smaller FILEGROWTH value for this file or to explicitly set a new file size."
is there a possibility that this process was causing my SP to timeout? are there any other log or debug files that SQL Express creates that might be helpful in discovering what caused the timeout? currently the log is at... ouch 10gigs restricted... maybe trying to autogrow from this while restricted is hogging resources?
As SQL Server Express databases are limited to 4GB per database, I just wonder why you need 10GB of logs ? Did you consider backing up your database and shrink your logfiles ?HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de|||when we created the database, we used the default setting for the log file, which was "By 10 percent, restricted growth ". currently we backed up the database, detached the DB, removed the old log file, and reattached the DB. it created a new log file and we set it to a smaller size. as i understand it the log file holds the uncommitted transactions, is this true? if we want the log file to stay at a certain size maybe i need to uncheck AutoGrowth? and going back to the original question, if SQL was trying to autogrow a 10 gig file, could this have used all the resources at the moment and timeout any stored procedures running during this autogrowth process?|||
Hi nattylife,
for an instance assump your Log File size is 12 GB, you have set up Auto Growth option in 20% , now when ever your T-Log file need to grow it will grow 12 GB * 20 % means it will grow 2.4 GB in size and while this process is running it occupy the server resource (yes it will effect while this happens in pick time).
If you stop/uncheck/disabled Auto Grow , you may be in trouble because if your T-log need to grow and Auto Grow is disabled it might be resulted in SUSPECT status of your database, so don't disabled Auto Grow set it in appropriate % / MB as per your *requirement/perdiction* in growth of your database. BTW what is your Recovery Model of your database?
Refer T-Log architecture in BOL to understand more, BOL is your best friend.
Hemantgiri S. Goswami
|||Your way of removing the log file is dangerous and not best practise. You should take a backup of your database and shrink the log afterwards, rather than just *deleting* it and let it recreate by SQL Server.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||Jens K. Suessmeyer wrote:
Your way of removing the log file is dangerous and not best practise. You should take a backup of your database and shrink the log afterwards, rather than just *deleting* it and let it recreate by SQL Server.
HTH, Jens K. Suessmeyer.http://www.sqlserver2005.de
we backed up the database before we do any questionable practices. the database is filled with 3 text files that our app recieves every day. inside each file are the records for the database. we archive these every day for 90 days in case we have any database issues. after doing some more research, i found how to shrink the log in the CTP which was the approach i was looking for, just didnt find until after the fact. i didnt realize that this log file would grow coninuously, i was under the assumption it would eventually get written over. so we are discussing a way to archive the ldf file now too.
|||Hi,
you should consider using the backup functions of SQL Server. You are able to do either full / differential or transaction log backups. A combination of those will help you to make your databases disaster-recoverable.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||i checked the backup options in the CTP. i see where i can do a log backup, but is this a manual process or when will it do it on a regular basis since i dont see any option to automate it. if i wanted to automate it, would i need to implement this with my own service or such?|||Hi,SQL Server Agent is not shipped with SQL Server Express. An approach could be to script out the backup command (using the functionality of the management studio) and schedule the execution of the script using an AT command (or any other scheduler) by executing the script with SQLCMD.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de