Accessing HttpContext.Current From Code Section In Report
Sep 6, 2007
I am trying to access HttpContext.Current in my report code section (report properties) since I have to look at a cookie. However, HttpContext.Current is always null. Has anyone managed to access HttpContex.Current from a report?
Hi,How do I get hold of the HttpContext.Current.User.Identity.Name from within an sqldatasource? I want to create a WHERE clause that says WHERE UserName = @UserName and the @UserName parameter be filled with the current user name. I would be able to do this in code, but I don't know how to get at this information from within a datasource. At a guess I tried to use the Cookie option from the drop down list, and use the name of the FormsAuthentication Cookie, but this didn't work. Is there a way I can do this? If so how? I don't want to resort to using a hidden field or anything like that if I can help it. Many thanks, Steve
I am trying to add an Imports statement to the beggining of the custome code section of my report but I recieve this error. There is an error on line 0 of custom code: [BC30465] 'Imports' statements must precede any declarations.
Hi, I dont know if theres a way to print a section of some report, for example a summary report, where I have several charts and tables, and I want to print just the first 2 charts Could this be done by mapping the document or separating it in some other way?
I tried using 'SubReports' control, but this way I need to have for example the first two charts in a different report (lets say 2charts.rdl), and then in the summary.rdl, add the control and set the link to 2charts.rdl,.... but I think this is pretty annoying considering the future modifications of the format in the 2charts.rdl...
I need to keep a section of a report the same size. I have now a table with a detail and group section. The table header must print on every page and the table footer must print on every page. The detail section can only be 16 rows. When I have more than 16 rows the report page breaks perfectly and puts the remaining rows on the next page along with repeating the header and footer. The problem is when there are fewer than 16 rows the table does not take up the full page and looks horrible. All my displayed data is in the data set. I have looked at padding the dataset with bogus rows that would show up at the end and just not display but would rather take care of this on the report end. Any ideas? Thanks, Chad
I'm trying to embed a report into a CRM IFrame. So I have the report created in Business Intelligence Visual Studio 2005, but I need to display it with none of the header details SRS displays by default.
Using the following URL I included rc:toolbar=false and rcarameters=false but they don't seem to make any difference. I basically need to display the report content as if it were part of that page and not an SRS hosted page.
I'm trying to embed a report into a CRM IFrame. So I have the report created in Business Intelligence Visual Studio 2005, but I need to display it with none of the header details SRS displays by default.
Using the following URL I included rc:toolbar=false and rcarameters=false but they don't seem to make any difference. I basically need to display the report content as if it were part of that page and not an SRS hosted page.
Here is the text I do not believe is correct or at the least misleading...
"If you want to terminate the external transaction from within your stored procedure or function. In this case, you call the Transaction.Current.Rollback method. "
You cannot terminate transactions declared in TSQL in SQLCLR routines.
I will attempt to explain my situation more clearly.
I need to get data from a data source using a DataFlow Task (which pushes the DataSet into a Variable) and process the data row by row in a ForNext (ADO Enumerated) Container. I don't want to map the columns into variables because the number of columns and the data types vary considerably and I want to make my package as "generic" as possible.
Is there a way, in Script, to read the current row of the ForEach Container from into an ADO DataRow so that thie names and values of each column can be accessed?
I know how to read the entire DataSet object from a Variable into an ADO DataSet and iterate through the rows in the normal way but this doesn't suit my purpose. It would be really useful if there was a way to do somehing similar with the current DataRow in the ForEach Container.
To explain what I am doing, the idea is to use the Column Names and Values for each row to construct an xml fragement, store it in a string Variable and (in the next step) use the Web Services Task to call a Web Method with the xml fragment (from the Variable) as one of the inputs.
A less attarctive alernative would be to use a Scipt outside a ForEach Container and loop through the rows of teh DataTable as descibed above and perhaps call the Web Service Task from teh Script. The proble is that I don't know how to do this either and it woudl be much "neater" anyway to use the ForEach Container.
is it possible to separate Grand Total of a sub group to a new page?
I tried using advanced mode, find the first line the Grand Total section and set its "RepeatOnNewPage" to true, but, when I execute the report, it will throw an error something like the value of RepeatOnNewPage of the TablixMemeber must be the same as its previous object.
I need my report pages to separate by subGroup(SubGroupA, SubGroupB, A+BTotal).
hi friends, I m new to asp.net... actually i have an application where the data for current week needs to be displayed from all the data present in different weeks.actually i want to retrieve the syllabus of current week from all weeks i used the below query but itz not working sqlString = "SELECT DATEPART(ww,sylWeeKID)AS Week FROM SylWeeks WHERE SyllabusIDFK= " & SylId & " GROUP BY DATEPART(ww,sylWeeKID) " ..can anyone suggest me how to retrieve data for current week , for a related item thanks in advance i need urgent help.
I have following query in stored procedure Select ContractId, Version, CreateDate, body, IsCurrentFrom CRM_Contracts where ContractId=@ContractId I am trying to access the value of IsCurrent field in Code behind using sqlDataSource to hide a radiobutton list in Formview control's when it is in Edit Mode. How can i do this.
Does anyone have code to access data? I want to create a sqldatasource control on the page, but would like to programmatically/manually/code-behind-wise to fill in my queries and their parameters. Thanks!
I am creating a stored procedure to generate the sp_addrolemember syntax, since SQL 2005 does not script role members. The stored procedure is named sp_ so it can be executed from any database. However, any reference to a view beginning with sys. only gets executed in the master database and not the current database. Why?
Try this code for a test.
Use Master
GO
Create Procedure sp_test as Begin
Select g.name, u.name From sys.database_principals u, sys.database_principals g, sys.database_role_members m Where g.principal_id = m.role_principal_id And u.principal_id = m.member_principal_id And u.name <> 'dbo' Order by g.name, u.name
End
-- Run sp_test from a database containing fixed database role members. The select only runs against master and not the current DB.
I have the following datasource... <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ***%>" ProviderName="<%$ ***%>" SelectCommand='SELECT "var1", "var2", "var3" FROM "tbl1"'> </asp:SqlDataSource> Would it be possible to use VB code to read the reasults from this datasource? (There are conditions that restrict me from running the query itself through VB code.) As always, any help is greatly appreciated. Thanks!
I am not able to access SSIS variables which are defined at Data Flow Task in a custom component. This custom component is developed by me in C#. How can i access these variables?
Please let me know if theres a way to access SSIS variables.
I am trying to retrieve and manipulate the value of the stored procedure parameters in the following custom code:
Code Snippet Public Function ShowLoading(ByVal intOption as integer, byVal BasicLoading as string, byVal BasicHealthExtra as string, byVal RiderLoading as string, byVal RiderHealthExtra as string, byVal TotalAmount as string) As string
dim strRider as String dim strCompanyName as string strCompanyName = Fields!CompanyName.Value
select case strCompanyName case "and Plus Rider ": strRider = "Plus Rider" case "and Assist Rider ": strRider = "Assist Rider" end select return strRider
End Function
However, i got this error when I try to preview the report: An error occurred during local report processing, The definition of the report :
'/reportC' is invalid. There is an error on line 5 of custom code: [BC30469] Reference to a non-shared member requires an object reference.
Any help is greatly appreciated. Thanks in advance.
I am working on reports in SSRS 2008 (not R2)... There are some reports with parameters that are hidden when the report is accessed through normal URL using ReportViewer.asx..The thing is that these hidden parameters need to be visible when the report is accessed using SSRS Report Manager.
My report has multiple datasets, and I want to access the fields of a particular dataset from custom code. The problem is that the name of the dataset to use is only calculated during the execution of the custom code.
Allow me to illustrate:
public function Test(data as DataSets, fieldName as string)dim datasetName as string = CalculateDatasetName()dim ds as Dataset = data(datasetName)' now here I want to get the fieldName out of the dataset.' in the report, I would do something like ' First(Fields!fieldName.Value, datasetName)' but in custom code, this obviously doesn't work.end function
I've been looking for a way to accomplish this, but it seems you cannot get data from a dataset through custom code (there is only the commandtext property). Also it is not possible to pass the Fields collection as a parameter, as I do not know the dataset name when in the report designer.
I hope my problem description is clear. Does anyone know how to solve this issue?
Table 1: AddressBook Fields --> User Name, Address, CountryCode
Table 2: Country Fields --> Country Code, Country Name
Step 1 : I have created a Cube with these two tables using SSAS.
Step 2 : I have created a report in SSRS showing Address list.
The Column in the report are User Name, Address, Country Name
But I have no idea, how to convert this Country Code to Country name.
I am generating the report using the Layout tab. ( Data | Layout | Preview ) Report1.rdl [Design]
Anyone help me to solve this issue. Because, in our project most of the transaction tables have Code and Code description in master table. I need to convert all code into corresponding description in all my reports.
How I can rebuild master db to change the Code Page of the current SQL7 , to convert my SQL7 from code page 850 to 1252 ? I have huge data in the old code page dbs , Does rebuild the master db mean reinsert the data again ?
How can I take this example Flat file and parse out each section to a new flat file? Each section starts with HD (header row)
http://www.webfound.net/flat_file_example.txt
e.g. an example output file based on above (cutting out the first section) would be:
http://www.webfound.net/flatfile_output.txt
Also, I'll need to grab a certain value in each header row (certain position in the 100 byte header row) to use that as part of the filename that's outputed. I assume it would be better to insert these rows into a temp table then somehow do a search on a specific position in the row...but that's impossible? The other route is to insert each row into a temp table separated out by fields but that is going to be too combursome because we have several formats to determine separation of fields based on the row type so I'd have to create many temp tables and many components in SSIS when all we want to do is again:
1) output each group (broken by each header row) into it's own txt file
2) use a field in the header row as part of the name of the output txt file (e.g. look at the first row, whcih is a header row in flat_file_example. txt. I want to grab the text 'AR10' and use that as part of the filename that I create
Any suggestions on how to approach this whole process in SSIS...the simplest approach that will work ?
We have both a custom data extension and a custom authentication extension for Reporting Services 2000.
Reports with one dataset work great, but reports with more than one dataset fail because the Authentication extension call GetUserInfo no longer has an HttpContext when the second dataset calls into it.
I've seen several people post this same problem on other forums but no answers. Documentation of an msdn article states "the security extension will always be loaded in the Report Server app domain" so I don't understand how we could lose the context.
Additionally, ALL samples of an authentication extension I've looked at have GetUserInfo coded the same way:
Code Snippet
Public Sub GetUserInfo(ByRef userIdentity As System.Security.Principal.IIdentity, ByRef userId As System.IntPtr) Implements Microsoft.ReportingServices.Interfaces.IAuthenticationExtension.GetUserInfo
If Not System.Web.HttpContext.Current Is Nothing _
AndAlso Not System.Web.HttpContext.Current.User Is Nothing Then
I need some assistance with Microsoft SQL Reporting Services. My problem is quite straight forward. I am using a ASP.NET 2.0 ReportControl locally on my machine and I would like to access a report which is hosted on another server within the network. How could I access this report. I am getting the following error:
The attempt to connect to the report server failed. Check your connection information and that the report server is a compatible version.
The request failed with HTTP status 404: Not Found.
Hi, I have created a sample report called Report1 in SSRS 2005. This currently is running locally on my workstation. I can even browse to it using the http address i.e. http://localhost/Reports The question is: How can someone else access this report on my machine. They can not browse to my machine by typing http://12.32.2.344/Reports
Do I need to do any configuration in my local IIS? Thanks
Hello. I made a reports in my local machine. How can other users in other machine view the reports? Do I need to install SP2? Any guidance please. Thanks. -Ron-
i am unable to browse my report server. this is the message im getting
The Report Server Windows service 'ReportServer$SQLEXPRESS' is not running. The service must be running to use Report Server. (rsReportServerServiceUnavailable)
I need a way to automatically generate a daily report of user names, time of access, and type of access (login, select, insert, update, delete, etc.) to a database.
We need to audit all accesses from all accounts to find out who is accessing the payroll system. We have already defined the security to be as tight as possible - however we need to monitor all Administrator accounts to ensure they are not being used to obtain sensitive information.
I have looked for some software to read the live SQL Transaction Logs, but none of the tools I have seen can do exactly what we require. For example, I've tried Lumigent Log Explorer (http://www.lumigent.com/products/le_sql.html), but it's not automated and the report output is just garble to our payroll staff.
I have looked up all Microsoft SQL Server partners but their software is all about data recovery and data reporting. We need Security Reporting.
I have created a general SQL Profiler trace that may suffice if everything else fails, but I still have no way of automating it - it relies on Real-Time monitoring which I can't trust (admin can turn this off, do their stuff, turn it back on). Also this is dependant on someone turning it off, save the log, turn it back on, every day - this person would be the Administrator - what admin would monitor themselves?
- SQL Trace seems like a good idea, how do I read the trace log file? How do I automate a trace?
- Can we automate the SQL Profiler to read the transaction log to find all accesses to a database?
- Does anyone know what we can do to automatically audit accesses to a database? What format can the report come in (pdf, xls, dbf, html etc.)
- Recommended software to try?
- Ideas for alternatives to try?
- Any companies/developers out there who know of a tool or are developing a tool to provide this sort of report?
- Is there a spec somewhere to let us write our own software to query the live transaction log?
Thanks, I appreciate any help. Kind Regards James Payne
I would like a report to display the number of users and the reports accessed for a certain duration of time[being able to go back and check for previous years as well].
I read on the msdn that 60 days worth of report log is kept,and the rest gets wipped off.Any suggestions on how I would be able to get user access list for the past year as well.
I'm accessing my report through a URL: http://reportserver/ReportServer?/Folder/ReportName&rs:Command=Render&rs:Format=CSV&rc:Parameters=true
I am getting an error: This report requires a default or user-defined value for the report parameter 'beg_dt'. To run or subscribe to this report, you must provide a parameter value. (rsReportParameterValueNotSet) Get Online Help
I do not want to pass the report parameters (to and from dates) through the URL. I want the dates to be entered by the user running the report. If I enter default parameters in Report Manager I am not prompted for the dates.