Showing posts with label contains. Show all posts
Showing posts with label contains. Show all posts

Friday, March 30, 2012

Lock: Timeout - @@LOCK_TIMEOUT

Hi,
Trace file which I have here, contains many Lock: Timeout
events. I don't understand how is it possible when
@.@.LOCK_TIMEOUT is set to -1 for all connections.
Thanks,
OJThis event is generated by a low level system component. Please post the
entire event data column for us to understand the situation.
--
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://weblogs.asp.net/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"OJ" <anonymous@.discussions.microsoft.com> wrote in message
news:200b01c4dca6$c0f48a30$a301280a@.phx.gbl...
> Hi,
> Trace file which I have here, contains many Lock: Timeout
> events. I don't understand how is it possible when
> @.@.LOCK_TIMEOUT is set to -1 for all connections.
> Thanks,
> OJ|||I'm not sure how this can help, but here it is (one of
many examples):
row_number=188337
event_class=27
text_Data=NULL
Binary_data=0x000707000DD07C4F23006F01DE541AB4
DatabaseID=14
HostName=PROD1
SPID=73
ObjectID=1333579789
IndexID=30
Mode=3
Also, some of them are caused by SPID lower than 50, and
mode in that case is: 5.
Thanks,
OJ
>--Original Message--
>This event is generated by a low level system component.
Please post the
>entire event data column for us to understand the
situation.
>--
>Wei Xiao [MSFT]
>SQL Server Storage Engine Development
>http://weblogs.asp.net/weix
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>"OJ" <anonymous@.discussions.microsoft.com> wrote in
message
>news:200b01c4dca6$c0f48a30$a301280a@.phx.gbl...
>> Hi,
>> Trace file which I have here, contains many Lock:
Timeout
>> events. I don't understand how is it possible when
>> @.@.LOCK_TIMEOUT is set to -1 for all connections.
>> Thanks,
>> OJ
>
>.
>|||As an optimization, SQL Server internally needs to check if a transaction
can acquire some locks without waiting. When this fails, the lock timeout
event is generated (with a duration of 0) but SQL Server will wait for the
lock instead.
The value of the "Duration" column indicates for how long SQL Server waits
before the timeout. If the value is 0, then this is the internal no-wait
timeout.
--
Wei Xiao [MSFT]
SQL Server Storage Engine Development
http://weblogs.asp.net/weix
This posting is provided "AS IS" with no warranties, and confers no rights.
"OJ" <anonymous@.discussions.microsoft.com> wrote in message
news:193d01c4dd59$34acbc60$a501280a@.phx.gbl...
> I'm not sure how this can help, but here it is (one of
> many examples):
> row_number=188337
> event_class=27
> text_Data=NULL
> Binary_data=0x000707000DD07C4F23006F01DE541AB4
> DatabaseID=14
> HostName=PROD1
> SPID=73
> ObjectID=1333579789
> IndexID=30
> Mode=3
>
> Also, some of them are caused by SPID lower than 50, and
> mode in that case is: 5.
> Thanks,
> OJ
>>--Original Message--
>>This event is generated by a low level system component.
> Please post the
>>entire event data column for us to understand the
> situation.
>>--
>>Wei Xiao [MSFT]
>>SQL Server Storage Engine Development
>>http://weblogs.asp.net/weix
>>This posting is provided "AS IS" with no warranties, and
> confers no rights.
>>"OJ" <anonymous@.discussions.microsoft.com> wrote in
> message
>>news:200b01c4dca6$c0f48a30$a301280a@.phx.gbl...
>> Hi,
>> Trace file which I have here, contains many Lock:
> Timeout
>> events. I don't understand how is it possible when
>> @.@.LOCK_TIMEOUT is set to -1 for all connections.
>> Thanks,
>> OJ
>>
>>.|||Thanks
>--Original Message--
>As an optimization, SQL Server internally needs to check
if a transaction
>can acquire some locks without waiting. When this fails,
the lock timeout
>event is generated (with a duration of 0) but SQL Server
will wait for the
>lock instead.
>The value of the "Duration" column indicates for how long
SQL Server waits
>before the timeout. If the value is 0, then this is the
internal no-wait
>timeout.
>--
>Wei Xiao [MSFT]
>SQL Server Storage Engine Development
>http://weblogs.asp.net/weix
>This posting is provided "AS IS" with no warranties, and
confers no rights.
>"OJ" <anonymous@.discussions.microsoft.com> wrote in
message
>news:193d01c4dd59$34acbc60$a501280a@.phx.gbl...
>> I'm not sure how this can help, but here it is (one of
>> many examples):
>> row_number=188337
>> event_class=27
>> text_Data=NULL
>> Binary_data=0x000707000DD07C4F23006F01DE541AB4
>> DatabaseID=14
>> HostName=PROD1
>> SPID=73
>> ObjectID=1333579789
>> IndexID=30
>> Mode=3
>>
>> Also, some of them are caused by SPID lower than 50, and
>> mode in that case is: 5.
>> Thanks,
>> OJ
>>--Original Message--
>>This event is generated by a low level system component.
>> Please post the
>>entire event data column for us to understand the
>> situation.
>>--
>>Wei Xiao [MSFT]
>>SQL Server Storage Engine Development
>>http://weblogs.asp.net/weix
>>This posting is provided "AS IS" with no warranties, and
>> confers no rights.
>>"OJ" <anonymous@.discussions.microsoft.com> wrote in
>> message
>>news:200b01c4dca6$c0f48a30$a301280a@.phx.gbl...
>> Hi,
>> Trace file which I have here, contains many Lock:
>> Timeout
>> events. I don't understand how is it possible when
>> @.@.LOCK_TIMEOUT is set to -1 for all connections.
>> Thanks,
>> OJ
>>
>>.
>
>.
>sql

Wednesday, March 21, 2012

Location of Report Files on Server

Does anyone know which directory contains the report (.rdl) files on the SQL
Server Reporting Services server? I'd like to access these files on the
server.
Thank you.There are no rdl files on the server. The process of deploying causes the
rdl to be stored in the database. If you need to retrieve the rdl that was
deployed you can do to report manager, click on the report, properties, edit
and give it a file name to put the rdl into.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Brian P" <BrianP@.discussions.microsoft.com> wrote in message
news:606DD94C-C004-4E30-BD72-DDBB0056C908@.microsoft.com...
> Does anyone know which directory contains the report (.rdl) files on the
> SQL
> Server Reporting Services server? I'd like to access these files on the
> server.
> Thank you.|||Bruce,
Understood. Thanks for the reply.
Brian
"Bruce L-C [MVP]" wrote:
> There are no rdl files on the server. The process of deploying causes the
> rdl to be stored in the database. If you need to retrieve the rdl that was
> deployed you can do to report manager, click on the report, properties, edit
> and give it a file name to put the rdl into.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Brian P" <BrianP@.discussions.microsoft.com> wrote in message
> news:606DD94C-C004-4E30-BD72-DDBB0056C908@.microsoft.com...
> > Does anyone know which directory contains the report (.rdl) files on the
> > SQL
> > Server Reporting Services server? I'd like to access these files on the
> > server.
> >
> > Thank you.
>
>

Monday, March 19, 2012

LocalReport: Object-in-Object as DataSource not working?

Hi,
I have a Report (VB.NET 2005), and I'm using Objects as DataSource.
I have the object objCompany, which contains a public property MyAdress
(instance of objAdress). objAdress has a propert Street.
When I add objCompany as a DataSource, I want to be able to show the
Street-property of MyAdress. So I do a drag-and-drop of that property from
the Data Sources - Window to the Report. Everything seems fine: I get a
textbox on my report with Value "=First(Fields!Street.Value,
"MyApplication_objCompany")".
But when I run the report, it doesn't show any value in it...
Does anybody knows why this happens? I somehow think because of the fact
that Street isn't directly on MyApplication_objCompany, but when I change it
into MyApplication_objCompany_MyAdress is complains about the fact that it
doesn't exist...
How should I do this?
Thanks a lot in advance,
PieterI found the solution here for nested objects and reporting services
localreport in the reportviewer:
http://www.gotreportviewer.com/objectdatasources/index.html
Apparently I have to do something like "=First(Fields!MyAdress.Value.Street,
"MyApplication_objCompany")".
It gave me these 2 errors:
The Value expression for the textbox 'Adresse' refers to the field
'ReportAdresse'.
Report item expressions can only refer to fields within the current data set
scope or, if inside an aggregate, the specified data set scope.
The Value expression for the textbox 'textbox19' has a scope parameter that
is not valid for an aggregate function.
The scope parameter must be set to a string constant that is equal to either
the name of a containing group, the name of a containing data region, or the
name of a data set.
But sddenly it started to work...
strange... :-/
"Pieter" <pietercoucke@.hotmail.com> wrote in message
news:u64%23GAkiGHA.1204@.TK2MSFTNGP02.phx.gbl...
> Hi,
> I have a Report (VB.NET 2005), and I'm using Objects as DataSource.
> I have the object objCompany, which contains a public property MyAdress
> (instance of objAdress). objAdress has a propert Street.
> When I add objCompany as a DataSource, I want to be able to show the
> Street-property of MyAdress. So I do a drag-and-drop of that property from
> the Data Sources - Window to the Report. Everything seems fine: I get a
> textbox on my report with Value "=First(Fields!Street.Value,
> "MyApplication_objCompany")".
> But when I run the report, it doesn't show any value in it...
> Does anybody knows why this happens? I somehow think because of the fact
> that Street isn't directly on MyApplication_objCompany, but when I change
> it into MyApplication_objCompany_MyAdress is complains about the fact that
> it doesn't exist...
> How should I do this?
> Thanks a lot in advance,
> Pieter
>

LocalReport.Render problem

At the moment my Intranet contains a few reports which are all shown using one reportviewer. I use this bit of code to switch one RDLC for another

===

ReportViewer1.LocalReport.DataSources.Clear();

ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("dsstrafstudie_DataTable1","ObjectDataSource2"));

ReportViewer1.LocalReport.ReportPath = "rptstrafstudie.rdlc";

ObjectDataSource2.FilterExpression = "datum = '" + Request.QueryString["datum"]+ "'";

===

It works just fine ! Now I Want to skip the reportviewer VIEW and just let the people download EXCEL or PDF export. So I add this bit of code

===

Warning[] warnings;

string[] streamids;

string mimeType;

string encoding;

string extension;

byte[] bytes = ReportViewer1.LocalReport.Render("Excel", null, out mimeType, out encoding, out extension, out streamids, out warnings);

FileStream fs = new FileStream(@."c:\output.xls", FileMode.Create);

fs.Write(bytes, 0, bytes.Length);

fs.Close();

===

But I keep getting the error "A data source instance has not been supplied for the data source "dsstrafstudie_DataTable1". Alltough I DO supply a DS instance only a few rules above ? What on earth am I doing wrong?

Thx in advance,

Puitje

Hi Puitje,

Did you find a solution for this error? I am experiencing the exact problem.

Thanks

|||Instead of using "ReportViewer1.LocalReport" create a new instance of a LocalReport and use that one.|||

I use a new variable LocalReport rp1, but error doesn't change ...

If i didin't use a datasource for the report the code works correctly.

Someone have any idea ?

Thanks

|||Did you add the datasource when you used Render?|||

Yes cause i copy the same code that visualize the Report correctly and i put it in a new function.

The function who render at video works correctly, the function who render manually give me the exception.

|||Are you sure that the objectdatasource you provided is correctly populated? Maybe you lost some event that populates it?|||I

I post the code :


these two function are called on Page_Load event ( the same on Page_PreRender).

The first function works correctly and display on my page the report with correct data.

The second function generate an exception on Render call.

He didn't find "DataforReport" istance.

The rdlc is a converted rdl.

FIRST

virtual public Boolean VisualizzaReport(ref Hashtable par)
{
ReportViewer rp1;
ReportDataSource ds1;
SqlDataSource sql1;
Database dbRep;
ControlParameter cp1;
Label l1;

// Definisce l'SqlDataSource per poi definire il ReportDataSource in funzione di questo
sql1 = new SqlDataSource();
sql1.ID = ReportPage.PageContent.SqlReportSource.ToString();
dbRep = new Database(this.NomeDatabase, this.NomeSP, ref sql1, 0);
sql1.SelectParameters.Clear();

foreach (DictionaryEntry de in par)
{
l1 = new Label();
l1.ID = "Label_"+de.Key.ToString();
l1.Text=de.Value.ToString();
l1.Visible = false;
this.content.Controls.Add(l1);

cp1 = new ControlParameter();
cp1.ControlID = l1.ID = "Label_" + de.Key.ToString();
cp1.Name = de.Key.ToString();
cp1.PropertyName = "Text";
cp1.Type = Type.GetTypeCode(de.Value.GetType());
// TypeCode.Int32;
sql1.SelectParameters.Add(cp1);
}
this.content.Controls.Add(sql1);
// Definisce il reportDataSource
ds1 = new ReportDataSource();
ds1.Name = "DataforReport";
ds1.DataSourceId = ReportPage.PageContent.SqlReportSource.ToString();

// Definisce il Report
rp1 = new ReportViewer();
rp1.ID = ReportPage.PageContent.ReportLocale.ToString();
rp1.ShowToolBar = false;
rp1.Width = new Unit(100, UnitType.Percentage); ;
rp1.Height = new Unit(100, UnitType.Percentage); ;
//rp1.ID = ReportPage.PageContent.ReportLocale.ToString();
rp1.LocalReport.DisplayName = this.NomeReport;
rp1.LocalReport.ReportPath = this.NomefileReport;
rp1.LocalReport.DataSources.Clear();
rp1.LocalReport.DataSources.Add(ds1);
rp1.LocalReport.Refresh();
this.content.Controls.Add(rp1);

return true;
}

SECOND

virtual public Boolean RenderReport(ref Hashtable par)
{
ReportViewer rp1;
ReportDataSource ds1;
SqlDataSource sql1;
Database dbRep;
ControlParameter cp1;
Label l1;

sql1 = new SqlDataSource();
sql1.ID = ReportPage.PageContent.SqlReportSource.ToString();
dbRep = new Database(this.NomeDatabase, this.NomeSP, ref sql1, 0);
sql1.SelectParameters.Clear();

foreach (DictionaryEntry de in par)
{
l1 = new Label();
l1.ID = "Label_" + de.Key.ToString();
l1.Text = de.Value.ToString();
l1.Visible = false;
this.content.Controls.Add(l1);

cp1 = new ControlParameter();
cp1.ControlID = l1.ID = "Label_" + de.Key.ToString();
cp1.Name = de.Key.ToString();
cp1.PropertyName = "Text";
cp1.Type = Type.GetTypeCode(de.Value.GetType());
// TypeCode.Int32;
sql1.SelectParameters.Add(cp1);
}
this.content.Controls.Add(sql1);
// Definisce il reportDataSource
ds1 = new ReportDataSource();
ds1.Name = "DataforReport" ;
ds1.DataSourceId = ReportPage.PageContent.SqlReportSource.ToString();

ReportViewer rp2;
rp2 = new ReportViewer();
rp2.LocalReport.ReportPath = "Fattura.rdlc";
rp2.LocalReport.DataSources.Clear();
rp2.LocalReport.DataSources.Add(ds1);
string deviceInfo =

"<DeviceInfo>" +

" <OutputFormat>PDF</OutputFormat>" +

" <PageWidth>8.5in</PageWidth>" +

" <PageHeight>11in</PageHeight>" +

" <MarginTop>0.5in</MarginTop>" +

" <MarginLeft>1in</MarginLeft>" +

" <MarginRight>1in</MarginRight>" +

" <MarginBottom>0.5in</MarginBottom>" +

"</DeviceInfo>";
byte[] data =rp2.LocalReport.Render("PDF", deviceInfo, out mimeType,out encoding, out extension, out streamids, out warnings);
FileStream fs = new FileStream(@."c:\prova.pdf", FileMode.Create);
fs.Write(data, 0, data.Length);
fs.Close();
//determine if format is rendered to the web or a file.

return true;
}

|||Why do you define 2 datasources? When do you add data to ds1?|||I think the refresh method in the first code triggers the datasource updating...

Wednesday, March 7, 2012

Local Report not changing back to original report

Hi
I have an aspx page which contains the report viewer control. I am using
this control in local processing mode.
Everything is working correctly except the following case
If I view a report (Report1) and then click on a hyperlink which drills down
to another report (Report2), the new report loads corectly and the
parameters are passed.
However, If I then select my generate report button on the form, it seems to
create the correct datasource and pass the right parameters, but instead of
displaying Report1 again, Report2 is still displayed and the data in the
report is incorrect.
I have dubugged the code and it all seems correct to me.When the generate
report button is clicked, the report path for Report1 is set, the new
collection of report parameters are created (which are correct) and the
datasources are setup.
The only thing that is not changing correctly is the report being rendered.
Here is some of my code
'btnGenerateReport_Click Method
rptReportViewer.LocalReport.ReportPath = MapPath("../Reports/" &
objReport.URL & ".rdlc")
rptReportViewer.LocalReport.DisplayName = objReport.Name
rptReportViewer.LocalReport.DataSources.Clear()
rptReportViewer.LocalReport.DataSources.Add(New
Microsoft.Reporting.WebForms.ReportDataSource("myDataset",
dsData.Tables(0)))
rptReportViewer.LocalReport.SetParameters(objReportParameters)
rptReportViewer.LocalReport.Refresh()
rptReportViewer.Visible = True
Is there anything else I need to do to refresh the report?
Any help would reeally be appreciated as I cannot find any help or examples
on how to do this.
Thanks
Lewis HolmesHi Lewis,
Thank you for your post.
This behavior is by design for the WebForm.ReportViewer control.
It is possible to change the DataSource of the localreport
It is not possible to change the report definition in the WebForms control
in LocalReport mode after it has been set once.
To work around the design limitation of the WebForms ReportViewer control,
you can remove the existing instance and create a new one which uses the
new report definition.
Here is a sample:
//Get the new report definition
StreamReader tr = new StreamReader( < your rdlc file path>);
string sDef = tr.ReadToEnd();
tr.Close();
//Create the new viewer and remove the old one
ControlCollection col = ReportViewer1.Parent.Controls;
int index = col.IndexOf(ReportViewer1);
ReportViewer newReportView = new ReportViewer();
col.AddAt(index, newReportView);
col.Remove(ReportViewer1);
newReportView.Visible = false;
newReportView.ProcessingMode = ProcessingMode.Local;
StringReader sr = new StringReader(sDef);
newReportView.LocalReport.LoadReportDefinition(sr);
newReportView.LocalReport.DataSources.Clear();
newReportView.LocalReport.DataSources.Add(new
Microsoft.Reporting.WebForms.ReportDataSource("DataSet1_DataTable1",
ObjectDataSource1));
newReportView.LocalReport.Refresh();
newReportView.Visible = true;
Hope this will be helpful!
Thank you!
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.