Showing posts with label page. Show all posts
Showing posts with label page. Show all posts

Tuesday, March 27, 2012

Calling Stored Procedure

I am trying to set up a call to a Stored Procedure to do an Insert. Here is my code snippet:

<%@. Page Language="VB" %>
<%@. import Namespace="System" %>
<%@. import Namespace="System.Data.SqlClient" %>
.
.
.
Dim loConn as New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Dim cmdInsert as New SQLCommand("AdminUser_Insert", loConn)
cmdInsert.CommandType = CommandType.StoredProcedure

Dim InsertForm As New SqlDataAdapter()
InsertForm.InsertCommand = cmdInsert

cmdInsert.Parameters.Add(New SqlParameter("@.RETURN_VALUE", SqlDbType.bigint, 8, "Account_Number"))
cmdInsert.Parameters("@.RETURN_VALUE").Direction = ParameterDirection.ReturnValue
cmdInsert.Parameters.Add(New SqlParameter("@.UserID", SqlDbType.varchar, 50, "UserID"))
cmdInsert.Parameters("@.UserID").Value = Request("UserID")
cmdInsert.Parameters.Add(New SqlParameter("@.Password", SqlDbType.varchar, 32, "Password"))
cmdInsert.Parameters("@.Password").Value = Request("Password")
cmdInsert.Parameters.Add(New SqlParameter("@.First_Name", SqlDbType.varchar, 32, "First_Name"))
cmdInsert.Parameters("@.First_Name").Value = Request("FirstName")
cmdInsert.Parameters.Add(New SqlParameter("@.Middle_Name", SqlDbType.varchar, 32, "Middle_Name"))
cmdInsert.Parameters("@.Middle_Name").Value = Request("MiddleName")
cmdInsert.Parameters.Add(New SqlParameter("@.Last_Name", SqlDbType.varchar, 32, "Last_Name"))
cmdInsert.Parameters("@.Last_Name").Value = Request("LastName")

loConn.Open()
command.ExecuteNonQuery()
loConn.Close()

I get the following error:

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30451: Name 'CommandType' is not declared.

This error happens on the line: cmdInsert.CommandType = CommandType.StoredProcedure

Any help would be appreciated,
GregTry importing System.data. I think you're just missing that|||Ugh. That did it. Thank you very much. Been staring at it for a while.

Gregsql

calling store procedure from aspx

hi , I would appreicate your help, I have created a store procedure in MS sql server 2000 to be called from aspx page.
The store procedure will have multiple functions:
checking if a file exist in c:\data
if file exist, it will use zip file command line to unzip the file and then run DTS package to upload the database.

The issue I am having is when I run the store procedure from MS query analyzer,I get a confirmation that the whole procedure ran successfully, but when I call the same procedure from aspx, althought the store procedure ran successfully, but I did not get any confirmation to the user in the aspx page to notify the user that the process successed... here is my code in where I think is not working,
CREATE PROCEDURE p_on_demand_dts_sales_option_price_report_3_ftest
@.id int , @.msg_output varchar(28) output
as
declare @.varcmd varchar(255),@.FileExist int
select @.varcmd = null
select @.varcmd ='dir :\Data_on_demand\sales_option_price_report.csv' -- check if file exist
EXEC @.FileExist = master..xp_cmdshell @.varcmd
set @.msg_output = 'The file exists'
Return 44

+++ The above store procedure use command line to check if the csv file exist, its suppose will return a output parameter and a return # BUT it did not. To my surprise, when I modify the above store procedure like this, it work
--
CREATE PROCEDURE p_on_demand_dts_sales_option_price_report_3_ftest
@.id int , @.msg_output varchar(28) output
as
set @.msg_output = 'The file exists'
Return 44

The second procedure does not do anything, except take input parameter and return a message output and return, this work.

since the second procedure works, it means that the code in aspx is correct, but I have no clue why it does not return output parameter and return # in the first procedure.

I would really appreciate anyone who could help.
thanks

ehx5what value are you trying to retuen form the stored proc ? the msg? or the value 44 ?
try :

set @.msg_output = 'The file exists'
return @.msg_output

hth|||What is your code in aspx to catch the output value?|||hi, thanks for your reply, the store procedure should get back to the client the following:
output message
and a return #

The aspx will get those values and present them to the user in label.

hope this will help.
thanks
Al|||then you would need to set up both as output parameters..


CREATE PROCEDURE p_on_demand_dts_sales_option_price_report_3_ftest
@.id int , @.msg_output varchar(28)OUTPUT, @.retid intOUTPUT as

and set the values to both the parameters..


set @.msg_output="the file exists"
set @.retid=44

return @.msg_output
return @.retid

hth

Sunday, March 25, 2012

calling report from asp.net page times out

Hello,
I built an aspx page to call a report from reportserver. The report takes
about 2 minutes to run and I am getting a timeout error from reporting web
services. Here is the error:
System.Net.WebException: The operation has timed-out.
at
System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest
request)
at
System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebReques
t request)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at Time.ReportServiceWS.ReportingService.Render(String Report, String
Format, String HistoryID, String DeviceInfo, ParameterValue[] Parameters,
DataSourceCredentials[] Credentials, String ShowHideToggle, String&
Encoding, String& MimeType, ParameterValue[]& ParametersUsed, Warning[]&
Warnings, String[]& StreamIds) in c:\inetpub\wwwroot\Time\Web
References\ReportServiceWS\Reference.vb:line 554
at Time.ReportLib.GenerateReport(String rptPath, String rptFormat,
Hashtable param) in c:\inetpub\wwwroot\Time\ReportLib.vb:line 50
The reprotw orks just fine from the report manager and from Report designer.
I am pretty sure it is a config issue somewhere. Does anyone know what
setting I need to change so that report does not timeout?
Thanks,
BivaBiva,
Wnen you instantiate a new RS object in your code, set the time out
property. Use rs.timeout=XXXXX. The should help,
Or, you should look at the IIS timeout param.
-rwiethorn
"Biva" wrote:
> Hello,
> I built an aspx page to call a report from reportserver. The report takes
> about 2 minutes to run and I am getting a timeout error from reporting web
> services. Here is the error:
>
> System.Net.WebException: The operation has timed-out.
> at
> System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest
> request)
> at
> System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebReques
> t request)
> at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
> methodName, Object[] parameters)
> at Time.ReportServiceWS.ReportingService.Render(String Report, String
> Format, String HistoryID, String DeviceInfo, ParameterValue[] Parameters,
> DataSourceCredentials[] Credentials, String ShowHideToggle, String&
> Encoding, String& MimeType, ParameterValue[]& ParametersUsed, Warning[]&
> Warnings, String[]& StreamIds) in c:\inetpub\wwwroot\Time\Web
> References\ReportServiceWS\Reference.vb:line 554
> at Time.ReportLib.GenerateReport(String rptPath, String rptFormat,
> Hashtable param) in c:\inetpub\wwwroot\Time\ReportLib.vb:line 50
> The reprotw orks just fine from the report manager and from Report designer.
> I am pretty sure it is a config issue somewhere. Does anyone know what
> setting I need to change so that report does not timeout?
> Thanks,
> Biva
>
>

Thursday, March 22, 2012

calling rdl from ASP page?

Hi everyone,

I'd like to call a report from an ASP 3.0 page. How could I do such thing?

Thanks for any link or sample provided,

Regards,

Hi,

You need to take a look at the ReportViewer control. It is also possible to use RDLC reports which are the same as normal RDL reports but they are included your project and don't need a reporting server anymore.

References:

Sample project in ASP.NET 2.0: http://www.codeproject.com/aspnet/ReportViewer.asp|||thanks for that.

Monday, March 19, 2012

Calling a web page from stored procedure

Hello,
Don't know if this is possible.
I have a website on a shared hosting. I can't put any components on the
server,
but I want to schedule a task to run regularly.
My idea was to schedule a stored procedure to run on a regular basis, that
will call
an ASP or ASP.NET page to perform tasks. Is something like this possible?
Are there alternative routes I may take?
ThanksHi
What is the operation that you would like to perform?
best Regards,
Chandra
http://chanduas.blogspot.com/
http://www.examnotes.net/gurus/default.asp?p=4223
---
"A_X_L_X" wrote:

> Hello,
> Don't know if this is possible.
> I have a website on a shared hosting. I can't put any components on the
> server,
> but I want to schedule a task to run regularly.
> My idea was to schedule a stored procedure to run on a regular basis, that
> will call
> an ASP or ASP.NET page to perform tasks. Is something like this possible?
> Are there alternative routes I may take?
> Thanks
>
>|||Chandra,
I'd like to retrieve data from the internet, either in XML or RSS or HTML
format.
Regards
"Chandra" <Chandra@.discussions.microsoft.com> wrote in message
news:54EF875B-18B6-4575-8FFC-A35AF441573F@.microsoft.com...
> Hi
> What is the operation that you would like to perform?
> --
> best Regards,
> Chandra
> http://chanduas.blogspot.com/
> http://www.examnotes.net/gurus/default.asp?p=4223
> ---
>
> "A_X_L_X" wrote:
>
that
possible?|||Would this data be stored in your SQL Server (you mentioned it's your
website)? If so, then contact your ISP and ask for the IP address and port
of the server hosting your database. You can connect via DSN using IP as the
server name, and use DTS to export the data.
"A_X_L_X" <aleksl at aol dot com> wrote in message
news:uCBPDV3VFHA.1148@.tk2msftngp13.phx.gbl...
> Chandra,
> I'd like to retrieve data from the internet, either in XML or RSS or HTML
> format.
> Regards
>
> "Chandra" <Chandra@.discussions.microsoft.com> wrote in message
> news:54EF875B-18B6-4575-8FFC-A35AF441573F@.microsoft.com...
the
> that
> possible?
>|||Thanks JT, but no, the data may be not in SQL Server, it maybe just
someone's RSS feed, or a WebService, or a web page.
Here's the structure:
Our Server -- Other Web Server
DB, Webserver - Some data
In General, every other platform but Microsoft's has this feature - like a
Java Servlet, that is actually web-server specific, and can be made to run
on a scheduled interval to pull data from the web and insert into the
database.
I've been programming a Windows Scheduler event in the past, when I had
control over the server, but not in this instance. So the only available
"scheduling" mechanizm is SQL Server jobs. Also, it is possible to make an
external machine do this, and then just send data back to generic "XML
gateway" i.e. to program an ASP / ASP.NET page to accept and parse data and
insert into SQL Server. But this is (a) too long and (b) too error-prone.
Has done this in the past also, even with distributed structure (for
fail-safe), still a maintenance nightmare.
This may not be the right newsgroup to ask, and yet I'm interested in
learning the answer.
Regards
Alex
"JT" <someone@.microsoft.com> wrote in message
news:Ob7QVh7VFHA.3572@.TK2MSFTNGP12.phx.gbl...
> Would this data be stored in your SQL Server (you mentioned it's your
> website)? If so, then contact your ISP and ask for the IP address and port
> of the server hosting your database. You can connect via DSN using IP as
the
> server name, and use DTS to export the data.
> "A_X_L_X" <aleksl at aol dot com> wrote in message
> news:uCBPDV3VFHA.1148@.tk2msftngp13.phx.gbl...
HTML
> the
basis,
>

calling a web page from scheduled job

hi all,
how can i call a web page from within a sql server 2000 scheduled job ?
thanks in advance
cosetta
See an example here
http://www.sqlteam.com/forums/topic...00&whichpage=2
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
|||thank you
your link opens new scenarios in my life!!!!!!
hi
cosetta
"Vaxman" wrote:

> See an example here
> http://www.sqlteam.com/forums/topic...00&whichpage=2
>
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!
>

calling a web page from scheduled job

hi all,
how can i call a web page from within a sql server 2000 scheduled job ?
thanks in advance
cosettaSee an example here
http://www.sqlteam.com/forums/topic...900&whichpage=2
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!|||thank you
your link opens new scenarios in my life!!!!!!
hi
cosetta
"Vaxman" wrote:

> See an example here
> http://www.sqlteam.com/forums/topic...900&whichpage=2
>
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!
>

calling a web page from scheduled job

hi all,
how can i call a web page from within a sql server 2000 scheduled job ?
thanks in advance
cosettaSee an example here
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=35900&whichpage=2
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||thank you
your link opens new scenarios in my life!!!!!!
hi
cosetta
"Vaxman" wrote:
> See an example here
> http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=35900&whichpage=2
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
>

Calling a Stored Procedure that does an insert and returns one value

Hi !

I have trying to do an insert with a subroutine that calls a stored procedure, but it doesn' t run. The page loads properly but nothing is inserted in the table of the database, no errors appears after submit the form.

<asp:Button id="SubmitButton" OnClick="Send_data" Text="Submit" runat="server"/>

Here is the code:


Sub Send_data(Sender As Object, E As EventArgs)

Dim CmdInsert As New SqlCommand("new_user1", strConnection)
CmdInsert.CommandType = CommandType.StoredProcedure

Dim InsertForm As New SqlDataAdapter()
InsertForm.InsertCommand = CmdInsert

CmdInsert.Parameters.Add(New SqlParameter("@.RETURN_VALUE", SqlDbType.bigint, 8, "User_id"))
CmdInsert.Parameters("@.RETURN_VALUE").Direction = ParameterDirection.ReturnValue

CmdInsert.Parameters.Add(New SqlParameter("@.e_mail", SqlDbType.varchar, 50, "e_mail"))
CmdInsert.Parameters("@.e_mail").Value = mail.Text()

End Sub

What it lacks?cmdInsert.ExecuteNonQuery|||Now when I submit the form the error is:

System.InvalidOperationException: ExecuteReader requires an open and available Connection. The connection's current state is Closed.

But the connection is available because in my webform appears several 'dropdownlists' with data from the database... And the 'strConnection' is the correct 'SqlConnection' declared before this subroutine like this: Dim strConnection As New SqlConnection(ConfigurationSettings.AppSettings("myConn"))|||If I put this runs:


...
strConnection.open()
cmdInsertar.ExecuteNonQuery
strConnection.close()

End Sub

Is this a good way of doing the insert with the called SP?
Why is not enough with this?:


Dim CmdInsert As New SqlCommand("new_user1", strConnection)

Thursday, March 8, 2012

Called web page from DTS

How can I execute or access a web page from a DTS package?

Both SQL server AND website are hosted on the same server (a Dual 2.4Gz Xeon with 2Gb RAM, RAID 5 etc)

I have 2 tables in SQL server 2000 that hold orders. These need to be posted into another table at a predefined time (ie: 4:30pm) and at the same time, access a remote address (a web service) and post certain elements of the order back.

Basically, can anyone help me out on how to execute a web page from a DTS.

I do NOT want to access a DTS from a webpage, which is all I'm finding at the moment.Not a problem - solved my problem|||How did you solve your problem? Did you use the ServerHTTP object through VBScript?

David|||Create stored proc with :

exec xp_cmdshell 'c:\temp\test.vbs

Call stored proc from DTS

test.vbs should contain something like:


Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run("http://localhost/yoursite/yourpage.aspx")

and then do whatever you like in 'yourpage.aspx'

Works fine for me, but then I have full control over the server. If the site is hosted with a hosting company you may have problems using xp_cmdshell due to the fact that it can pose a security problem because it can pretty much perform any command on the server.|||Why did you create the stored proc, and why did you create the vbs file? Why not just execute the vbscript within the DTS package itself?|||Note: I didn't post ALL of my code for the stored proc - I only posted the relevent part of it.

There's a lot more going on in the procedure which I haven't mentioned, which I didn't want to post.

Wednesday, March 7, 2012

call an ASP page using xp_cmdShell

Hi, here is what I'm trying to accomplish. I'm using Win2k, IIS, SQL Server 2000 sp3a. I'm trying to call an ASP page from the SQL environment. The ASP page updates a record in a database.

Code in Query Analyzer:
exec master..xp_cmdshell 'c:\temp\test.vbs'

If I double-click the vbs file from Windows Explorer, the vbs file calls the asp file and the database updates. When I run the code in SQL I get a message telling me 1 row was affected, yet no record was written to the DB. I've read an article telling me it was possible to call an ASP page from SQL. http://www.eggheadcafe.com/articles/20010426.asp . But it does not work for me?

Code for VBS and ASP files, I don't think the problem is here though?

VBS:
Set WshShell = WScript.CreateObject("WScript.Shell")
URL = "http://localhost/spg/sprocData.asp"
WshShell.Run(URL)
set WshShell = Nothing

ASP:
dim objConn1,objCmd1, strSQL, adCmdText
adCmdText = 1
strSQL = "INSERT INTO tblXMLInsert (SEQ, VENDORID) VALUES ('test','test')"

set objConn1 = Server.CreateObject("ADODB.Connection")
objConn1.Open "Provider=SQLOLEDB;Server=SERVER;Database=SPG;UID=t est;PWD=test"
set objCmd1 = Server.CreateObject("ADODB.Command")
set objCmd1.ActiveConnection = objConn1
objCmd1.CommandText = strSQL
objCmd1.CommandType = adCmdText
objCmd1.Execute
set objConn1 = Nothing
set objCmd1 = Nothing

Thanks for your help.Sorry dude....

I have to say this...Why the heck are you making life hard for yourself?

Web stuff stays on the web server
SQL stuff stays on the SQL Server.

xp_cmdshell is a VERY DANGEROUS utility - it usually operates at sa level and unless you want to trash your SQL server - dont use it. Just dont!

It may be the permissions of the user you are using to access SQL server from the seb server. Make sure the test user has change permissions on the table you are trying to alter. Start SQL Analyser & connect to the database using the test user. If you manually run the TSQL code in SQL Analyser on the server & it works, then its not permissions issue for the user.
It may be your vbs code.

Post back if problems.

Cheers,

SG|||hahahaha... thats right, dont mix...

I never cant do that... If you can... tell me how :)|||Let me explain what I'm trying to accomplish, it sounds like there is a better way to do this. I have an insert/update trigger that will use the xp_cmdshell command. I call the ASP page with 1 variable. The ASP page queries the database for a bunch of records, based on the variable I receive from the trigger. The returned recordset is parsed and converted to XML then sent to an external server. The ASP page receives the status of the file transfer and I update our database accordingly. The code posted above obviously does not show all these steps. Thanks|||Hi

CAN I BE MORE BLUNT???

DONT USE XP_CMDSHELL FOR THIS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

ASP is designed to interact with a database, and send/retrieve information and I'm guessing you are still learning how to do this. Best method of attack is not to short circuit security ( and any good DBA will tell you this ) by not uising xp_cmdshell ( A good DBA will also "break" your fingers for using xp_cmdshell so be warned ). Not all you read on development boards is correct nor security minded.

Get all your development in ASP correct from the ground up & with solid engineering approach. You will be better off in the long run AND if someone managed to exploit this xp_cmdshell link, they could easily compromise your site security - ( www.sqlsecurity.com ) .

Fancy a pink slip for this effort? It would be worth doing to get rid of someone who KNOWINGLY compromised my site security.

SQL 2000 will return records in XML natively so you can do everything within TSQL and pass the trigger result back to an ASP page easily enough. Work it out correctly - dont make nasty short cuts.

HTH

Cheers,

SG.|||Hi, sqlguy7777. Your last statement says:
SQL 2000 will return records in XML natively so you can do everything within TSQL and pass the trigger result back to an ASP page easily enough. Work it out correctly - dont make nasty short cuts.

Creating XML in TSQL is no problem, my problem is passing the trigger results back to the ASP page. How do I do that, if xp_cmdShell is not the way to go what is the better way. Thanks|||Howdy,

I think you may have to change the approach to the problem & how you are handling the changes to the data & the database.

I was thinking through the problem, and it occurs to me you are making life difficult for yourself.

Instead of messing around with vbs scripts & triggers shooting info backwards & forwards, keep all the database functionality within the database. You could write a trigger result to a table, then scan the table frequently via a script to look for a change and then kick an action off. If you are only scanning a small table it would take milliseconds for a scan so unless your server is being flogged into the ground, speed should not be an issue. ( assuming you are not doing this 1000s of times a second, in which case using a RAM based pinned table would be much quicker. )

Keep it simple & it stays robust/reliable. As soon as it gets messy, the chance of things going wrong goes throught he roof. I speak from hard learned experience. Of course, you can totally dismiss what I'm saying ( which is you choice of course ) but I am trying to save you some grief.

I'd also suggest you talk to your DBA - quite often they can help with design issues and it makes long term support of systems easier & cheaper & faster.

HTH,

Cheers,

SG.

Saturday, February 25, 2012

Calendar Style Report

Any ideas on how I might be able to create a report with a page for each
month, columns for each day, rows for each week and scheduled activities on
the appropriate date?
I have a db with rows for each activity and columns for various types of
dates, i.e, start, review, submit, etc.
TIA
deanIt's actually quite a lot of work...
You need to drive the report from a dataset that has generated calendar data
in it, and join your real data to this table on the date values. Then of
course you can group on month and week in the standard way.
There are two tricky parts. The first is generating the calendar data --
have you ever done this before? Here is an example -- not sure if this is
exactly the same as the one that I use, but it looks similar.
http://blogs.x2line.com/al/archive/2004/04/10/229.aspx
The second is a *bit* tricky, but mostly it is tedious: setting up the
columns for all the days in any given week. The information for each column
has a different offset (starting with 0 and going to 6) from the first day
of week.
Basically, it's a lot of SQL.
>L<
"Dean" <Dean@.discussions.microsoft.com> wrote in message
news:938ADD6C-2509-40C5-8339-AED5B2EC9224@.microsoft.com...
> Any ideas on how I might be able to create a report with a page for each
> month, columns for each day, rows for each week and scheduled activities
> on
> the appropriate date?
> I have a db with rows for each activity and columns for various types of
> dates, i.e, start, review, submit, etc.
> TIA
> dean

Friday, February 24, 2012

Calendar Control issues

Hi all,

When I click on a calendar control for date parameters the page will freeze or throw a java script error. This does not happen all the time, and is not isolated to one PC. It happens randomly on several PCs. Is there any known issue with this control?

regards,

Bill

The only issue that I have seen is if you try to open the calendar control while it is still loading the iframe for the calendar. Next time it happens see if the IE status bar is still showing the page loading.|||It is in the process of loading. There are times though, when it takes 10 seconds or more to load locally, and much longer if a user is accessing the page outside of the local LAN. If the user clicks on the control during the load, a java error occurs and the page is disabled. This cant be by design , could it? :-)|||

No it is not by design. :) I am surprised that it does take so long to load. Is this happening the first time you view the report or when navigating through calendar months? If it is the first time, the calendar is one of the last things loaded on the page, if the entire page is still loading (IE will render objects and allow interaction even though the page hasn't finished loading) the calander may not be loaded until the page is loaded. Are you viewing the reports through Report Manager or your own pages? If they are your own pages, perhaps there is some improvement that can be made there to speed up the page load.

As far as anything you can do to Report Server, there isn't anything that can currently be done to affect this behavior. We are aware of the issue and are looking to fix it in a future version. In the meantime users need to be aware of the issue and wait to open the drop down until the page has fully loaded.

|||Thank you for your answer. The page is displayed through report services, not my own page. I hope you have a fix soon, as it is making report services for my company very difficult to use. On a side note, report services displayed in IE7 with a calendar control will not work at all.|||

There have been quite a few reports of problems with the calendar control (just search the forums) and the basic answer seems to be "we cant replicate any problem" so I think MS dont know what to fix.

Certainly I have the same issue as you, the calendar controls throwing script errors and taking ages to load.

|||I am just hoping that some sort of hot fix is available soon. Like I said though, it does not work at all with IE7 so if MS is planning to release IE7 as a critical update like it is rumored, it will break all RS sites.|||IE7 is only in beta 3 mode, I believe the issues with IE7 and RS will be resolved but there is no fix for IE7 Beta 3.|||So I guess the answer is "deal with it" At least most companies dont use parameters in reporting , so it should not be a big issue. |||Just to clarify, we are aware of the issue with the script errors and how to fix it. In order to be fixed in a QFE, a customer will need to contact CSS and request the fix, otherwise look for the fix in a future release. If your are hindered by this issue, your best course of action is to contact Customer Support and request a fix.|||It appears it is an IE issue. I am able to work with the calendar control fine with Firefox. Can anyone verify this?

Calendar Control issues

Hi all,

When I click on a calendar control for date parameters the page will freeze or throw a java script error. This does not happen all the time, and is not isolated to one PC. It happens randomly on several PCs. Is there any known issue with this control?

regards,

Bill

The only issue that I have seen is if you try to open the calendar control while it is still loading the iframe for the calendar. Next time it happens see if the IE status bar is still showing the page loading.|||It is in the process of loading. There are times though, when it takes 10 seconds or more to load locally, and much longer if a user is accessing the page outside of the local LAN. If the user clicks on the control during the load, a java error occurs and the page is disabled. This cant be by design , could it? :-)|||

No it is not by design. :) I am surprised that it does take so long to load. Is this happening the first time you view the report or when navigating through calendar months? If it is the first time, the calendar is one of the last things loaded on the page, if the entire page is still loading (IE will render objects and allow interaction even though the page hasn't finished loading) the calander may not be loaded until the page is loaded. Are you viewing the reports through Report Manager or your own pages? If they are your own pages, perhaps there is some improvement that can be made there to speed up the page load.

As far as anything you can do to Report Server, there isn't anything that can currently be done to affect this behavior. We are aware of the issue and are looking to fix it in a future version. In the meantime users need to be aware of the issue and wait to open the drop down until the page has fully loaded.

|||Thank you for your answer. The page is displayed through report services, not my own page. I hope you have a fix soon, as it is making report services for my company very difficult to use. On a side note, report services displayed in IE7 with a calendar control will not work at all.|||

There have been quite a few reports of problems with the calendar control (just search the forums) and the basic answer seems to be "we cant replicate any problem" so I think MS dont know what to fix.

Certainly I have the same issue as you, the calendar controls throwing script errors and taking ages to load.

|||I am just hoping that some sort of hot fix is available soon. Like I said though, it does not work at all with IE7 so if MS is planning to release IE7 as a critical update like it is rumored, it will break all RS sites.|||IE7 is only in beta 3 mode, I believe the issues with IE7 and RS will be resolved but there is no fix for IE7 Beta 3.|||So I guess the answer is "deal with it" At least most companies dont use parameters in reporting , so it should not be a big issue. |||Just to clarify, we are aware of the issue with the script errors and how to fix it. In order to be fixed in a QFE, a customer will need to contact CSS and request the fix, otherwise look for the fix in a future release. If your are hindered by this issue, your best course of action is to contact Customer Support and request a fix.|||It appears it is an IE issue. I am able to work with the calendar control fine with Firefox. Can anyone verify this?

Calculations in Page Footer

hai,
i need some help regarding calculations done in page footer. Presently i am developing a report using subreports. I am not utilising pageNofM concept. and i have to display page numbers manually. If i have 2 subreports in one main report. i have to display page numbers like this.

If my 1st subreport is displaying 2 pages, then i have to display like this

1 Page 1 of 2
1 Page 2 of 2

If my 2nd subreport is displaying 2 pages, then i have to display like this

2 Page 1 of 2
2 Page 2 of 2

Page left side printed numbers are related to subreport numbers. if the page shows first subreport then it shows 1 otherwise 2. i have coded this successfully in main report and placed this formula at left side of the page footer. i am facing problem at subreport page count. I have used to code this using page number but the left side value changes if I wrote any code in the formula which displays page 1 of 2 which i placed at right side of the page. since 1 week i am trying for this concept

can anybody help me?

Thanks in advance,
BhuvanaBhuvana,
Can you post the code you used in the formula?|||I have split the group header into 2 and placed the same subreport in each section.

I have used this code in a formula placed in each group header section

global i as number
whileprintingrecords
i=i+1
formula=i

i have used this code to display subreport number left side and placed this formula leftside of the main report page.

global i as number
whileprintingrecords
formula=replace(cstr(i),".00","")

It is perfectly working. The problem with rightside page number printing.

Rightside of the page i have used this code to print page numbers

whileprintingrecords
global i as number
global p as number

if replace(cstr(i),".00","")="1" then
formula="Page "+replace(cstr(pagenumber),".00","")
elseif replace(cstr(i),".00","")="2" then
formula="Page "+Replace(cstr((pagenumber-p)),".00","")+" of "+ Replace(cstr(p),".00","")
elseif replace(cstr(i),".00","")="3" then
formula="Page "+Replace(cstr((pagenumber-(2*p))),".00","")+" of "+ Replace(cstr(p),".00","")
elseif replace(cstr(i),".00","")="4" then
formula="Page "+Replace(cstr((pagenumber-(3*p))),".00","")+" of "+ Replace(cstr(p),".00","")
end if

and i have placed the following code in pagefooter section and supressed it

global p as number
whileprintingrecords
if {@.SampleFormula}="1" then
p=p+1
end if
formula=p

I have assigned "1" to sampleformula in first group header section and assigned 0 to sampleformula in second group header section.

Please provide me the solution
Bhuvana|||Bhuvana,
As you have used the variable formula at the right side code, change of formula will affect the value of formula at left side code. What is your expected outcome at the right side?|||hai,
suppose if i have total number of pages in 1st subreport is 4 then i want to display right side as page 1 of 4 for page 1, page 2 of 4 for page 2 and so on. while displaying second subreport first page i want to repeat as page 1 of 4 ,
page 2 of 4, page 3 of 4, page 4 of 4 etc.

i am waiting for your reply

Regards,
Bhuvana|||Bhuvana,
At the formula you used at the right side, try to use different name other than formula as that is referenced by other Formula code

Sunday, February 12, 2012

Calculating grand total in header

I have a report that has a Page Total and a Grand Total in the header.
The Page Total is being calculated from a field in the report like so:
=sum(ReportItems!tcBodyAmount.Value)
where tcBodyAmount is the name I gave the textbox in the report body
that calculates a value.
However, now I need a Grand Total and I can't get the syntax correct.
I've tried summing the PageTotal and I get a different error each time.
I can't use a field in the header. I tried doing a sum on the Page
Total sum but get the error that aggregate functions can't be nested.
I've also tried moving the totals into the body of the report and I get
the error that aggregate functions can only be used in the header and
footer.
The help feature was never loaded so I don't have access to that. Can
anyone give me some guidance on this? Thank you!try a sub report that calcs the total and thats in your header|||I tried that and got a message saying that a subreport can't be placed
in the header or footer|||Try placing in the header
= sum(Fields!Fieldname.Value,"datasetname")
see if that works
--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.
"Carol" wrote:
> I have a report that has a Page Total and a Grand Total in the header.
> The Page Total is being calculated from a field in the report like so:
> =sum(ReportItems!tcBodyAmount.Value)
> where tcBodyAmount is the name I gave the textbox in the report body
> that calculates a value.
> However, now I need a Grand Total and I can't get the syntax correct.
> I've tried summing the PageTotal and I get a different error each time.
> I can't use a field in the header. I tried doing a sum on the Page
> Total sum but get the error that aggregate functions can't be nested.
> I've also tried moving the totals into the body of the report and I get
> the error that aggregate functions can only be used in the header and
> footer.
> The help feature was never loaded so I don't have access to that. Can
> anyone give me some guidance on this? Thank you!
>|||I had tried exactly that and I get the error message that fields cannot
be called in the header. I even did a search on that one and found an
old posting that said that cannot be done.
I tried the Grand Total as =sum(ReportItems!PageTotal.Value), thinking
that should sum all of the page totals. I didn't get an error, but
instead got no output for both the Grand Total and the Page Total when
I did that. Weird because when I clear that sum, the Page Total prints
fine.