Showing posts with label single. Show all posts
Showing posts with label single. Show all posts

Friday, March 9, 2012

Request a web page from SQL Server

Hi,

I want to request a webpage from sql server every hour.

I tried to make a job which contains a single ActiveX step.
I select VBScript and type

Dim Http
Set Http = CreateObject("Microsoft.XMLHTTP")
Http.Open "GET", "http://localhost/updater_watch.aspx", False
Http.Send
Set Http = Nothing

I set a schedule and on every execution I get an error in the event log.

Event Type: Warning
Event Source: SQLSERVERAGENT
Event Category: Job Engine
Event ID: 208
Date: 8/11/2003
Time: 8:15:00 PM
User: N/A
Computer: NEXUS
Description:
SQL Server Scheduled Job 'updater' (0x444D7F519E70534C9EF81B1570382AEE) - Status: Failed - Invoked on: 2003-08-11 20:15:00 - Message: The job failed. The Job was invoked by Schedule 1 (s1). The last step to run was step 1 (invoke).

Is this the right way to do this task? When I execute the VBScript without the sql server, it runs without a problem.

Thanks, PanayotWhy not set it up as a ongoing job?|||Thanks for the reply garrydawkins,

that is what I have done.
I open eterprise manager and go to management-sql server agent-jobs-new job.
Then create the job, set a its type to activex, make a schedule to execute it every hour. it executes but exits with error. I suspect that it cannot create the xmlhttp object properly in the VB code.

If I only leave two simple statements:

dim somevar
set somevar = nothing

then the job exits with success.

Tuesday, February 21, 2012

Repost - How to reset page numbers in PDF Report

Hello,
Looking for ideas on this one. Would like a report (single pdf file) whose page numbers would be say 1 of 5 and then 1 of 6, etc.. The page number resets would be based on the changing value of some field like summarybillnumber.
Any help/ideas would be appreciated.
ThanksAdd this to the Code property of the report:
shared offset as integer
public function GetPN(reset as boolean, pagenumber as integer) as integer
if reset
offset = pagenumber - 1
end if
return pagenumber - offset
end function
Use the function in the page number expression, basing the reset property on
the presence of something that only appears on the first page of the group.
For example:
="Page " & Code.GetPN(ReportItems!tag.Value = "Tag",Globals!PageNumber)
Note: To make this work, the offset member variable must be declared as
shared. This means the report cannot be run multiple times simultaneously,
otherwise the separate runs will smash the shared member variable's value.
In addition, failure to access the pages sequentially will have unexpected
results (since the shared offset member variable will be set out of order).
The only way to use this hack is to schedule runs of the report and save off
the rendered results. Users cannot run the report live or even from
snapshot history, since pagination occurs when the report is rendered, not
when the snapshot is taken.
The ability to conditionally reset page numbering on specific page breaks,
such as group page breaks, is on our wishlist for a future version, but this
feature is not likely to make it into SQL 2005.
Brian Welcker
Group Program Manager
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"chanley54" <chanley54@.discussions.microsoft.com> wrote in message
news:BDDF14C9-ACA0-4F8B-98BB-91839AAB6644@.microsoft.com...
> Hello,
> Looking for ideas on this one. Would like a report (single pdf file)
> whose page numbers would be say 1 of 5 and then 1 of 6, etc.. The page
> number resets would be based on the changing value of some field like
> summarybillnumber.
> Any help/ideas would be appreciated.
> Thanks
>