Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all 20764 articles
Browse latest View live

SSRS reports built in 2008 to render in .doc word format must be changed to render .docx format as from ssrs 2012 .doc is deprecated

$
0
0


Microsoft Word and Microsoft Excel 1997-2003 Rendering

TheReporting Services BIFF8 rendering extensions Reporting Services reports to the Microsoft Word and Microsoft Excel 1997-2003 binary interchange file format. SQL Server 2014 includes extensions that render in the Microsoft Office 2007-2010 Open XML format.

SSRS reports built in 2008 to render in .doc word format must be changed to render .docx format as from ssrs 2012 doc is deprecated.

Currently I have SSRS reports built in 2008 to render in .doc word format 

Will .doc rendering will not work if i migrate the ssrs 2008 report to ssrs 2012?






Visual Studio 2015 Can't Deploy Reports Created in Visual Studio 2013: "There are multiple root elements"

$
0
0

Hello

I have upgraded to Visual Studio 2015 from 2013 but when I try to deploy reports they often don't work as show an error saying:

The definition of this report is not valid or supported by this version of Reporting Services. The report definition may have been created with a later version of Reporting Services, or contain content that is not well-formed or not valid based on Reporting Services schemas. Details: There are multiple root elements.

However if I keep trying to deploy them then they sometimes decide to work.

Some reports though I can't get to deploy no matter how many times I try and now if I try to open them in Visual Studio 2013 they don't work in their either as Visual Studio 2015 must have updated them so I cannot deploy the reports at all now.

Is this a bug and if so is it likely to be fixed soon? I am on Visual Studio 2015 Update 3?

Another post here: https://social.technet.microsoft.com/Forums/windows/en-US/cc0b573d-5d05-4f89-90cc-86732601a80c/vs-2015-ssrs-error-there-are-multiple-root-elements?forum=sqlreportingservices says to change the xml definition year from 2010 to 2016 but I have checked my report and it already shows as 2016 so this doesn't seem to be my issue:

<?xml version="1.0" encoding="utf-8"?><Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">

Thanks

Robin


Robin Wilson

SSRS (response flush redirect)

$
0
0

Hi

i have report viewer how export to image for display redirect  other page

last my code 

response flush redirect

response end

Query performance decrease when using STRTOVALUE to create a calculated measure based on a Parameter

$
0
0

Hi!

We are writing a query where the data we want to extract depends on the value of a parameter, this way we create a "dynamic" table where the fields you show in the rows change depending on the value you place in the parameters.

To do so, we are creating calculated measures that retrieve the CURRENTMEMBER.MEMBER_CAPTION of the Parameters value, which always corresponds to an attribute of a dimension, like [Hotel].[Hotel Name]. This calculated measure will be the field we will place in the table rows. What's more we are also basing on the parameter's value the data ON ROWS, so the query only retrieves the attributes we want to use in the table. 

The query does work this way, however the performance goes dramatically down. Anyone has any idea how to make the query more efficient or any alternative way to do it? Please find below the piece of the query that refers to this. 

____

WITH 

MEMBER [Measures].[Row1] AS STRTOVALUE(@pmtr_Row1+".CURRENTMEMBER.MEMBER_CAPTION")

MEMBER [Measures].[Row2] AS STRTOVALUE(@pmtr_Row2+".CURRENTMEMBER.MEMBER_CAPTION")

MEMBER [Measures].[Row3] AS STRTOVALUE(@pmtr_Row3+".CURRENTMEMBER.MEMBER_CAPTION")

MEMBER [Measures].[Row4] AS STRTOVALUE(@pmtr_Row4+".CURRENTMEMBER.MEMBER_CAPTION")

MEMBER [Measures].[Row5] AS STRTOVALUE(@pmtr_Row5+".CURRENTMEMBER.MEMBER_CAPTION")

NON EMPTY
NONEMPTY({
STRTOMEMBER(@pmtr_Row1).CHILDREN *
STRTOMEMBER(@pmtr_Row2).CHILDREN * 
STRTOMEMBER(@pmtr_Row3).CHILDREN * 
STRTOMEMBER(@pmtr_Row4).CHILDREN *
STRTOMEMBER(@pmtr_Row5).CHILDREN},{[Measures].[X],[Measures].[Y]})
}
ON ROWS

_______

Any idea will be more than welcome!

Many thanks in advance!

Create new role using c#

$
0
0

I am trying to put together a C# code to create a new role. I am using SQL server 2016. 

Can someone please provide some guidelines?

Thanks

SSRS 2016 error: Subscription can't be created or edited because the credentials used to run the report are not stored, or if a linked report, the link is no longer valid

$
0
0

While clicking New Subscription or Editing existing subscription I get the error in title. I already provided credentials to run the report as my windows credentials. Strange part is, it doesn't ask every time even though credentials are not changed. It pops up again. Then I simply redeploy the report and datasource. It works sometimes.

When I get to edit subscription and execute it following error is encountered: (from log file)

Data exception occurred: System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Cannot create a connection to data source ''. ---> Microsoft.ReportingServices.Diagnostics.Utilities.DataSourceOpenException: Cannot create a connection to data source ''. ---> System.NotSupportedException: Non-Windows user credentials were supplied for a non-http connection to Analysis Services. The Microsoft SQL Server Analysis Services data extension requires Windows Integrated Security unless connecting via http or https.
   at Microsoft.ReportingServices.Library.ReportingService2005Impl.PrepareQuery(DataSource DataSource, DataSetDefinition DataSet, DataSetDefinition& DataSettings, Boolean& Changed, String[]& ParameterNames)
   at Microsoft.ReportingServices.WebServer.ReportingService2010.PrepareQuery(DataSource DataSource, DataSetDefinition DataSet, DataSetDefinition& DataSettings, Boolean& Changed, String[]& ParameterNames)

Tried by selecting shared datasource and custom datasource, same error comes.

Any help is appreciated!

Multiple Oddities with new SSRS 2016 Installation

$
0
0

I've installed Reporting Services 2016 Developer Edition and am encountering some odd behaviors which I believe may be related.

1. When deploying a report project from SQL Server Data Tools (VS 2015), many objects are deployed but then I start receiving "The Underlying Connection Was Closed" error messages. Searching for information leads to SSL as a possible culprit, but the standard ways of resolving this (changing SSL via IIS Administration tool) are not available in an SSRS implementation. 

2. Using IE or Chrome, I can access the report management site (http://<server>/Reports) and click around a bit. However, after a few clicks (or even refreshes), the site becomes unavailable for about 10 seconds.  

3. Accessing the site from the server itself via http://localhost/Reports is stable. There are no crashes or unavailability. However, http://<server>/Reports prompts me for a login. Using [this MSDN site](https://msdn.microsoft.com/en-us/library/cc281253.aspx) as a guide (To configure a report server to use Windows integrated security
), I've configured the server to run under a service account in our Active Directory Domain.

4. Even though I've configured the server to run with a domain service account at setup and when creating the Web Service and Web Portal URLs, the rssreportserver.config still shows the NT Service\ReportServer account. 

Here are the parts of the rsreportserver.config file that I believe are more pertinent to this aspect of SSRS. 

```
<URLReservations>
<Application>
<Name>ReportServerWebService</Name>
<VirtualDirectory>RS</VirtualDirectory>
<URLs>
<URL>
<UrlString>http://+:80</UrlString>
<AccountSid>S-1-5-80-2885764129-887777008-271615777-1616004480-2722851051</AccountSid>
<AccountName>NT SERVICE\ReportServer</AccountName>
</URL>
</URLs>
</Application>
<Application>
<Name>ReportServerWebApp</Name>
<VirtualDirectory>Reports</VirtualDirectory>
<URLs>
<URL>
<UrlString>http://+:80</UrlString>
<AccountSid>S-1-5-80-2885764129-887777008-271615777-1616004480-2722851051</AccountSid>
<AccountName>NT SERVICE\ReportServer</AccountName>
</URL>
</URLs>
</Application>
</URLReservations>
<Authentication>
<AuthenticationTypes>
<RSWindowsNTLM/>
</AuthenticationTypes>
<RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel>
<RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario>
<EnableAuthPersistence>true</EnableAuthPersistence>
</Authentication>
```

web.config is configured for Windows and for impersonation.

```

    <authentication mode="Windows" />
    <identity impersonate="true" />

```

The only real difference in this section between the 2016 Development environment and our working 2012 Production environment is that the second `<Application>` section is for "Reports" in 2012 but is "ReportServerWebApp" in 2016.

Are there any SSRS gurus out there who can help me get to the bottom of this cluster of seemingly-related issues?

Select Row and export or print out what was selected

$
0
0

Hello,

I am using SSRS 2014 I have a user requesting to select certain rows after making a selection from a parameter base SSRS report and either export or print out (maybe into new report) what he selected.  A very simple example:


ID#    Item#  Amount
124     7777     24.00
135     1786     30.00
789     2486     15.00
897     9999       5.00
678     4567    200.00


The user wants to select ID# 124, 897, and 678 and have it print out or able to export out.  He doesn't need to see ID# 135, 789, and 897.  Further parameter will not do. 

How can I do this?  any suggestion will be appreciated.  Thank you in advance.


SQL Reporting Deployment / License Error

$
0
0

First to know you that i am not a person related to SQL server or Programming background but i stuck in a issue asking by my vendor/developer and told me to resolve issue.

We have One Project therefore i installed SQL Server 2014 Std and now vendor/developer told me that he is unable to open reports.

When he tries to open .SLN files Visual Studio 2010 Shell Splash screens open and "Invalid License Data.Reinstall is required" error comes i search a lots and performed number of steps but not successes

I asked him that he needs Visual Studio License but he told me that reporting is supporting with SQL Server 2014 Std Edition.

https://msdn.microsoft.com/en-us/library/cc645993(v=sql.120).aspx#Reporting

Now i have a question can i open these reports directly on SQL Server ? if yes than How ?

Is it necessary to open .SLN files in Visual Studio 2014 Shell ? although its not working also VS 2014 Shell is unable to open .SLN files.

Is there any another way to open/deploy reports ?

System Contains :

Windows Server 2012 R2

Microsoft SQL Server 2014 Std (FULL FEATURES)

SQL Question

$
0
0

Hi Friends,

May i know when to use CTE and Temp table?

For Eg: i need to store 1 crore records in one temporary set, and to use tat in another logic, so which need to be considered and why.

Thanks & Regards

Santosh S

From SSRS#0 create a shortcut (or a link) to a report located on an SSRS#1

$
0
0

we have several SSRS servers (ex: SCOM, SCCM, etc...)  each having their own reports. I need to use a separate SSRS server ( SSRS_0 )  as a central location for some (a selection ) of the reports located on the other SSRS servers. in other words, SSRS_0 will contain "shortcuts" to reports located on SSRS_1, SSRS_2, .... , SSRS_n    report servers; so that users can find a selection of relevant reports using one URL (for SSRS_0) , instead of having to look in every and each SSRS server many reports.

is this (or any thing close)  possible?

Thanks


repeat using 2 columns

$
0
0

How do you repeat data across 2 columns like this?

rsviewer the remote host closed the connection

$
0
0

I have a rsviewer webpart on SharePoint 2013 page.

2 server farm - server1 http internal and server2 http external internet.

internal server: rsviewer runs report just fine   

external server (https from public internet) :  after 120 seconds the report throws  (found in sharepoint logs), all the other reports under 90-120  seconds run fine.

Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.ServiceModel.CommunicationException:The remote host closed the connection. The error code is 0x800704CD

It looks like timeout and I reset executiontimout = 3000600 in Web.config on IIS but it did not help.What could be the reason for "The remote host closed the connection" ? who isremote host here?

 

Reporting services configuration manager cannot find Report Server instance (SQL server 2008 R2 standard)

$
0
0

Oh no, WMI error again.. last time I had WMI problem, on a different server, it took me a lot of effort troubleshooting the issue. This is totally unrelated, but is a good reference for what it can entail troubleshooting this kind of problem: [SOLVED] A MOF syntax error occured, installing SQL Server 2012 Advanced Express 64 bit edition

So, to the issue this time. A sql 2008 R2 server was migrated a couple of days ago, including its reporting services. The report server is working, and the reporting services configuration manager was working too at time of installation. A few days later, when I try to open the Reporting Services Configuration Manager, it does not give me an instance. It is blank, so I cannot connect to the report server.

First thing to try is push the connect button, it then gives me an error:

An unknown error has occurred in the WMI Provider. Error Code 80080005


I can't find anything about this error code. What does it mean ?

OK then, let's start by checking the WMI logs in the event viewer, a refresher how to do that:

To view WMI Events in Event Viewer
1.Open Event Viewer. On the View menu, click Show Analytic and Debug Logs. Locate the Trace channel log for WMI under Applications and Service Logs | Microsoft | Windows | WMI Activity.
2.Right-click the Trace log and select Log Properties. Click the Enable Logging check box to start the WMI event tracing. For more information about channels, see Event Logs and Channels in Windows Event Log.
3.WMI events appear in the event window for WMI-Activity. Double-click an event in the list to see the detailed information. You can view an event in XML View or in Friendly View format.


and I get:

Id = {DA8D4EF9-E66C-0001-B896-8DDA6CE6D101}; ClientMachine = machine; User = machine\user; ClientProcessId = 7640; Component = Unknown; Operation = Start IWbemServices::CreateInstanceEnum - root\Microsoft\SqlServer\ReportServer\RS_MSSQLSERVER\v10 : MSReportServer_Instance;
 ResultCode = 0x80080005; PossibleCause = Unknown


So, it is trying to create an instance: IWbemServices::CreateInstanceEnum

And the name of the class is: root\Microsoft\SqlServer\ReportServer\RS_MSSQLSERVER\v10

I attempt to do the same with wbemtest. I can connect to the namespace, I can see the class, but trying to instantiate will give an error:

Id = {DA8D4EF9-E66C-0001-B896-8DDA6CE6D101}; ClientMachine = machine; User = machine\user; ClientProcessId = 9312; Component = Unknown; Operation = Start IWbemServices::CreateInstanceEnum - ROOT\Microsoft\SqlServer\ReportServer\RS_MSSQLSERVER\v10 : MSReportServer_Instance;
 ResultCode = 0x80041010; PossibleCause = Unknown

So, different error, doing the same thing, this time the error is "Invalid Class"

Applying remedies for this error:

1.       Open the SQL Server Report Server folder.<Install Driver>:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer
2.       Open the “bin” folder.
3.       Copy and rename the file “reportingservices.mof”
4.       Register the file using the following command
Mofcomp <Install Driver>:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\bin\reportingservices.mof 
After doing the steps above, we should connect to the Reporting Services well. 
If the solution above does not above, could you please help to collect the following information?
1.       Could you connect to SQL Server Configuration Manager?

2.       The logs of SQL Server Reporting Services.
3.       Does the Reporting Services windows service work fine?
4.       The more detailed error message.
5.       Any more information.

Did both:

C:\>mofcomp "c:\Program Files\Microsoft SQL Server\MSRS10_50.MS
SQLSERVER\Reporting Services\ReportServer\bin\reportingservices.mof"
Microsoft (R) MOF Compiler Version 6.3.9600.16384
Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
Parsing MOF file: c:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Re
porting Services\ReportServer\bin\reportingservices.mof
MOF file has been successfully parsed
Storing data in the repository...
Done!

and


C:\>regsvr32 "C:\Program Files\Microsoft SQL Server\100\Shared\reportingserviceswmiprovider.dll"

DllRegisterServer in c:\program files\Microsoft sql server\100\shared\reportingserviceswmiprovider.dll suucceeded


Nothing changed. Just for the sake of it, let's verify WMI as a whole:

C:\Windows\system32>winmgmt /verifyrepository
WMI repository is consistent


run a simple query, see things work:

wmic path "Win32_Process" get Name


works. OK then, let's run wmidiag, results in 5 errors:

44039 13:21:18 (1) !! ERROR: WMI CONNECTION errors occured for the following namespaces: .................................................. 1 ERROR(S)!
44040 13:21:18 (0) ** - Root/aspnet, 0x8004100E - (WBEM_E_INVALID_NAMESPACE) Namespace specified cannot be found.
44041 13:21:18 (0) **
44042 13:21:18 (1) !! ERROR: WMI GET operation errors reported: ........................................................................... 2 ERROR(S)!
44043 13:21:18 (0) ** - Root/CIMV2, Win32_PerfFormattedData_Spooler_PrintQueue, 0x80041002 - (WBEM_E_NOT_FOUND) Object cannot be found.
44044 13:21:18 (0) **   MOF Registration: 'WMI information not available (This could be the case for an external application or a third party WMI provider)'
44045 13:21:18 (0) ** - Root/CIMV2, Win32_PerfRawData_Spooler_PrintQueue, 0x80041002 - (WBEM_E_NOT_FOUND) Object cannot be found.
44046 13:21:18 (0) **   MOF Registration: 'WMI information not available (This could be the case for an external application or a third party WMI provider)'
44047 13:21:18 (0) **
44048 13:21:18 (0) ** WMI MOF representations: ............................................................................................ OK.
44049 13:21:18 (0) ** WMI QUALIFIER access operations: .................................................................................... OK.
44050 13:21:18 (1) !! ERROR: WMI ENUMERATION operation errors reported: ................................................................... 2 ERROR(S)!
44051 13:21:18 (0) ** - ROOT/CIMV2/POWER, InstancesOfAsync, 'CIM_Sensor', 0x80080005 - .
44052 13:21:18 (0) **   MOF Registration: 'WMI information not available (This could be the case for an external application or a third party WMI provider)'
44053 13:21:18 (0) ** - ROOT/CIMV2/POWER, InstancesOfAsync, 'CIM_NumericSensor', 0x80080005 - .
44054 13:21:18 (0) **   MOF Registration: 'WMI information not available (This could be the case for an external application or a third party WMI provider)'

Nothing related, but 2 of the errors are the same, and explanation of this error simply is = WBEM_UNKNOWN.
44106 13:21:18 (0) ** 2 error(s) 0x80080005 - (WBEM_UNKNOWN) This error code is external to WMI.

OK, so, what should I try next?

OK different approach:

open up reporting services configuration manager, then check the event log. I see an error there. OK, push find button, and check event viewer again. same error, source Distributed DCOM:

The server {73E709EA-5D93-4B2E-BBB0-99B7938DA9E4} did not register with DCOM within the required timeout.

Unfortunately, this seems to be a generic error that says WMI did not respond, and is no help at all.

I have also checked the reporting services logs but not found any related entry. The log resides at:

C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\LogFiles

Could anyone help please ?


Christmas spirit all year long Please remember to vote on useful replies. Mark answers. Help to answer questions of others while you are visting the forums. Thank you.



From SSRS#0 create a shortcut (or a link) to a report located on SSRS#1

$
0
0

we have several SSRS servers (ex: SCOM, SCCM, etc...)  each having its own reports. I need to use a separate SSRS server ( SSRS_0 )  as a central location for some (a selection ) of the reports located on the other SSRS servers; in other words, SSRS_0 will contain "shortcuts" to reports located on SSRS_1, SSRS_2, .... , SSRS_n    report servers; so that users can find a selection of relevant reports using one URL (for SSRS_0) , instead of having to look in every and each SSRS's many reports.

is this (or any thing close)  possible?

Thanks




SSRS 2016 Branding

$
0
0
I'm trying to use the Branding feature in SSRS 2016 however I do not see the option(I am an Administrator). Is this something that needs enabling? I should point out I've installed this on a Windows 8 machine, not sure it that might be the issue.

SSRS Local Report Render Error

$
0
0

Hello experts,

I had been creating SSRS using Vs2010 and SQL 2008 R2,

recently i formatted my pc and installed Windows 10, Vs2013, SQL 2016,

intermittently i am getting error while a call to Render port is given 

byte[] bytes = lr.Render(fileExt, null, out mimeType, out encoding, out filenameExtension, out streamids, out warnings);
these gets called from 
ExportShdlVsDisp
emailsend

why the localreport.render is giving following error

   at Microsoft.Reporting.WinForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings)
   at Microsoft.Reporting.WinForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
   at Microsoft.Reporting.WinForms.LocalReport.Render(String format, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
   at Microsoft.Reporting.WinForms.Report.Render(String format, String deviceInfo, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
   at Kings.ERP.SaleReports.ExportShdlVsDisp(LocalReport lr, String filename, String fileExt) in d:\13vs\Kings ERP\Reports\SalesReports.cs:line 958

Microsoft.Reporting.WinForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.ReportingServices.Diagnostics.Utilities.RSException: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: The specified operation is not valid.  ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: The specified operation is not valid. 
   at Microsoft.ReportingServices.RdlExpressions.ReportRuntime.RegisterRuntimeErrorInExpression(VariantResult& result, Exception e, IErrorContext iErrorContext, Boolean isError)
   at Microsoft.ReportingServices.RdlExpressions.ReportRuntime.RegisterRuntimeErrorInExpression(VariantResult& result, Exception e)
   at Microsoft.ReportingServices.RdlExpressions.ReportRuntime.EvaluateTextRunValueExpression(TextRun textRun)
   at Microsoft.ReportingServices.ReportProcessing.OnDemandReportObjectModel.TextRunImpl.GetResult(IReportScopeInstance romInstance)
   at Microsoft.ReportingServices.ReportIntermediateFormat.TextRun.EvaluateValue(IReportScopeInstance instance, OnDemandProcessingContext context)
   at Microsoft.ReportingServices.OnDemandReportRendering.InternalTextRunInstance.EvaluateOriginalValue()
   at Microsoft.ReportingServices.OnDemandReportRendering.InternalTextRunInstance.get_ProcessedWithError()
   at Microsoft.ReportingServices.OnDemandReportRendering.TextBoxInstance.get_ProcessedWithError()
   at Microsoft.ReportingServices.Rendering.SPBProcessing.TextBox.WriteCustomNonSharedItemProps(RPLElementProps nonSharedProps, RPLWriter rplWriter, PageContext pageContext)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.PageItem.WriteNonSharedItemProps(RPLElementProps elemProps, RPLWriter rplWriter, PageContext pageContext)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.PageElement.WriteElementProps(RPLElementProps elemProps, RPLWriter rplWriter, PageContext pageContext)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.TextBox.WriteItemToStream(RPLWriter rplWriter, PageContext pageContext)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.TextBox.CalculatePage(RPLWriter rplWriter, PageItemHelper lastPageInfo, PageContext pageContext, PageItem[] siblings, RepeatWithItem[] repeatWithItems, Double parentTopInPage, Double& parentPageHeight, Interactivity interactivity)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.Tablix.TablixContext.CalculateDetailCell(PageItem topItem, Int32 colIndex, Boolean collect, PageContext pageContext)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.Tablix.TablixContext.AddDetailCell(TablixCell cellDef, Int32 colIndex, Double cellColDefWidth, Double cellCellDefHeight, Boolean ignoreCellPageBreaks, Boolean collect, Boolean& partialItem)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.Tablix.CreateDetailCell(Tablix tablix, TablixMember colMemberParent, Int32 colGridIndex, TablixContext context)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.Tablix.CreateColumnMemberChildren(Tablix tablix, TablixMember colMemberParent, Int32 defTreeLevel, Boolean parentBorderHeader, Int32 parentRowIndex, Int32 parentColIndex, TablixContext context, Boolean createDetail, LevelInfo& parentLevelInfo)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.Tablix.CreateColumnMemberChildren(Tablix tablix, TablixMember colMemberParent, Int32 defTreeLevel, Boolean parentBorderHeader, Int32 parentRowIndex, Int32 parentColIndex, TablixContext context, Boolean createDetail, LevelInfo& parentLevelInfo)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.Tablix.CreateRowMemberChildren(Tablix tablix, TablixMember rowMemberParent, InnerToggleState parentToggleState, Int32 defTreeLevel, Boolean parentBorderHeader, Int32 parentRowIndex, Int32 parentColIndex, Int32 level, TablixContext context, Boolean& advanceRow, LevelInfo& parentLevelInfo, List`1& ignoreTotals, Boolean keepTogether)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.Tablix.CreateRowMemberChildren(Tablix tablix, TablixMember rowMemberParent, InnerToggleState parentToggleState, Int32 defTreeLevel, Boolean parentBorderHeader, Int32 parentRowIndex, Int32 parentColIndex, Int32 level, TablixContext context, Boolean& advanceRow, LevelInfo& parentLevelInfo, List`1& ignoreTotals, Boolean keepTogether)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.Tablix.CreateRowMemberChildren(Tablix tablix, TablixMember rowMemberParent, InnerToggleState parentToggleState, Int32 defTreeLevel, Boolean parentBorderHeader, Int32 parentRowIndex, Int32 parentColIndex, Int32 level, TablixContext context, Boolean& advanceRow, LevelInfo& parentLevelInfo, List`1& ignoreTotals, Boolean keepTogether)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.Tablix.CreateTablixItems(Tablix tablix, TablixContext context)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.Tablix.CalculatePage(RPLWriter rplWriter, PageItemHelper lastPageInfo, PageContext pageContext, PageItem[] siblings, RepeatWithItem[] repeatWithItems, Double parentTopInPage, Double& parentPageHeight, Interactivity interactivity)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.ReportBody.CalculatePage(RPLWriter rplWriter, PageItemHelper lastPageInfo, PageContext pageContext, PageItem[] siblings, RepeatWithItem[] repeatWithItems, Double parentTopInPage, Double& parentPageHeight, Interactivity interactivity)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.ReportSection.CalculatePage(RPLWriter rplWriter, Int32 page, Int32 totalPages, Int32 regionPageNumber, Int32 regionTotalPages, Boolean firstSectionOnPage, Boolean lastSection, Interactivity interactivity, Double heightToBeUsed, PageItemHelper& lastBodyInfo, Boolean& delayedHeader, Boolean& delayedFooter, Boolean& lastSectionOnPage)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.Report.NextPage(RPLWriter rplWriter, ReportSectionHelper& lastPageInfo, Int32 page, Int32 totalPages, Interactivity interactivity, Boolean hasPaginationChunk)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing.GetReportNextPage(Stream& stream, Boolean collectPageBookmarks)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing.GetNextPage(RPLReport& rplReport, Boolean collectPageBookmarks)
   at Microsoft.ReportingServices.Rendering.SPBProcessing.SPBProcessing.GetNextPage(RPLReport& rplReport)
   at Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream)
   --- End of inner exception stack trace ---
   at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.HandleRenderingException(ReportRenderingException rex)
   at Microsoft.ReportingServices.ReportProcessing.Execution.RenderReport.Execute(IRenderingExtension newRenderer)
   at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderReport(IRenderingExtension newRenderer, DateTime executionTimeStamp, ProcessingContext pc, RenderingContext rc, IChunkFactory yukonCompiledDefinition)
   at Microsoft.Reporting.LocalService.CreateSnapshotAndRender(ReportProcessing repProc, IRenderingExtension renderer, ProcessingContext pc, RenderingContext rc, SubreportCallbackHandler subreportHandler, ParameterInfoCollection parameters, DatasourceCredentialsCollection credentials)
   at Microsoft.Reporting.LocalService.Render(String format, String deviceInfo, String paginationMode, Boolean allowInternalRenderers, IEnumerable dataSources, CreateAndRegisterStream createStreamCallback)
   at Microsoft.Reporting.WinForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings)
   --- End of inner exception stack trace ---
   at Microsoft.Reporting.WinForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings)
   at Microsoft.Reporting.WinForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
   at Microsoft.Reporting.WinForms.LocalReport.Render(String format, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
   at Microsoft.Reporting.WinForms.Report.Render(String format, String deviceInfo, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
   at Kings.ERP.SaleReports.ExportShdlVsDisp(LocalReport lr, String filename, String fileExt) in d:\13vs\Kings ERP\Reports\SalesReports.cs:line 958

how can i understand what is going wrong in Localreport Render

 private void emailsend()
        {
            try
            {
                var outlookType = Type.GetTypeFromProgID("Outlook.Application");
                if (outlookType == null)
                {
                    MessageBox.Show("Outlook Not Installed");
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            Properties.Settings.Default.ShdlVsDispatchCC = txtCC.Text;
            pgbEmail.PerformStep();
            try
            {
                using (SqlConnection con = new SqlConnection(Appvaribales.ConnectionString))
                {
                    string scheduleperiod = dtpFrom.Value.ToString("yyyyMMdd") + '-' + dtpto.Value.ToString("yyyyMMdd");
                    SqlCommand cmd = new SqlCommand();
                    int fromid=0, uptoid=0;
                    if (Properties.Settings.Default.GateOutEntry.Equals(true))
                    {
                        int.TryParse(txtserialfrm.Text, out fromid);
                        int.TryParse(txtserialupto.Text, out uptoid);
                        cmd = new SqlCommand("ShdlVsDispAccountsGE", con);
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.Add(new SqlParameter("@plantid", ErpMdi1.ID));
                        cmd.Parameters.Add(new SqlParameter("@doc_gls", doc_gls));
                        cmd.Parameters.Add(new SqlParameter("@fromdate", dtpDispatchedOn.Value.ToString("yyyyMMdd")));
                        cmd.Parameters.Add(new SqlParameter("@todate", dtpDispatchedOn.Value.ToString("yyyyMMdd")));
                        cmd.Parameters.Add(new SqlParameter("@controlgl", controlgl));
                        cmd.Parameters.Add(new SqlParameter("@acslfrom", AcSLFrom));
                        cmd.Parameters.Add(new SqlParameter("@acslto", AcSLTo));
                        cmd.Parameters.Add(new SqlParameter("@fromid", fromid));
                        cmd.Parameters.Add(new SqlParameter("@uptoid", uptoid));

                    }
                    else
                    {
                        cmd = new SqlCommand("ShdlVsDispAccounts", con);
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.Add(new SqlParameter("@plantid", ErpMdi1.ID));
                        cmd.Parameters.Add(new SqlParameter("@doc_gls", doc_gls));
                        cmd.Parameters.Add(new SqlParameter("@fromdate", dtpFrom.Value.ToString("yyyyMMdd")));
                        cmd.Parameters.Add(new SqlParameter("@todate", dtpto.Value.ToString("yyyyMMdd")));
                        cmd.Parameters.Add(new SqlParameter("@controlgl", controlgl));
                        cmd.Parameters.Add(new SqlParameter("@acslfrom",AcSLFrom));
                        cmd.Parameters.Add(new SqlParameter("@acslto",AcSLTo));
                    }

                    //DataSet dsAl = new DataSet("AccountList");
                    //Fill Table Fill
                    con.Open();
                    DataTable dtAl = new DataTable();
                    dtAl.Load(cmd.ExecuteReader());

                    DataTable dtcompany = new DataTable();
                    cmd.CommandText = "select top 1 * from company";
                    cmd.CommandType = CommandType.Text;
                    dtcompany.Load(cmd.ExecuteReader());
                    con.Close();
                    // http://msdn.microsoft.com/en-us/library/ms252091(v=vs.80).aspx
                    //http://www.codeproject.com/Tips/165548/C-Code-snippet-to-send-an-Email-with-attachment-fr
                    //Walkthrough: Printing a Local Report without Preview  http://msdn.microsoft.com/en-us/library/ms252091%28VS.80%29.aspx
                    // Printing Reports Programmatically Using C# and SQL Server 2000 Reporting Services http://blogs.msdn.com/b/bryanke/archive/2004/02/11/71491.aspx
                    LocalReport lr = new LocalReport();
                    lr.SubreportProcessing += new Microsoft.Reporting.WinForms.SubreportProcessingEventHandler(LocalReport_SubreportProcessing);
                    lr.ReportPath = lblReportFile.Text;
                    string emailreport;
                    string plantid = ErpMdi1.ID.ToString();
                    //
                    //ReportParameter p1 = new ReportParameter("plantid", plantid);
                    ReportParameter p2 = new ReportParameter("fromdate", dtpFrom.Value.ToShortDateString());
                    ReportParameter p3 = new ReportParameter("todate", dtpto.Value.ToShortDateString());
                    lr.SetParameters(new ReportParameter[] { p2, p3 });
                    #region
                    //
                    //                                MailMessage myMail = new MailMessage();
                    //                                MailAddress mail_address = new MailAddress(txtFromMailID.Text.ToString());
                    //                                SmtpClient smtpcl = new SmtpClient(ConfigurationManager.AppSettings["mail_server"].ToString(), Int32.Parse(ConfigurationManager.AppSettings["mail_port"]));
                    //                                myMail.From = mail_address;
                    //                                myMail.Subject = scheduleperiod;
                    //                                myMail.Body = @"Dear Sir,
                    //                                               Kindly see The Schedule Vs. Dispatches Report.
                    //                                               Developed By www.kingsiq.com";
                    //                                smtpcl.Credentials = new NetworkCredential(txtFromMailID.Text.ToString(), txtPassword.Text.Trim());
                    //                                smtpcl.EnableSsl = true;
                    //                                smtpcl.EnableSsl = true;
                    #endregion
                    int emailscount = 0;
                    if (dtAl.Rows.Count > 0)
                        pgbEmail.Step = 100 / dtAl.Rows.Count;
                    else
                        pgbEmail.Step = 1;
                    foreach (DataRow dtr in dtAl.Rows)
                    {
                        if (!String.IsNullOrWhiteSpace(dtr["email_id"].ToString().Trim()))
                        {
                            lr.DataSources.Clear();
                            lr.DataSources.Add(new ReportDataSource("DataSet1", LoadShdlVsDispData(dtr["ac_code"].ToString())));
                            lr.DataSources.Add(new ReportDataSource("company", dtcompany));
                            emailscount++;
                            lblemailsent2.Text = emailscount.ToString() + "/" + dtAl.Rows.Count.ToString() + " - "+ dtr["name"].ToString();
                            lblemailsent2.Refresh();
                            emailreport = ExportShdlVsDisp(lr, ErpMdi1.dtLoggedAt.ToString("yyyyMMdd") + "-ShdlVsDisp", cmbOutputFormat.SelectedItem.ToString());

                            Outlook.Application oApp = new Outlook.Application();
                            // Get the NameSpace and Logon information.
                            Outlook.NameSpace oNS = oApp.GetNamespace("mapi");

                            // Log on by using a dialog box to choose the profile.
                            oNS.Logon(Missing.Value, Missing.Value, true, true);

                            // Alternate logon method that uses a specific profile.
                            // TODO: If you use this logon method,
                            //  change the profile name to an appropriate value.
                            //oNS.Logon("YourValidProfile", Missing.Value, false, true);

                            // Create a new mail item.
                            Outlook.MailItem oMsg = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);

                            // Set the subject.
                            oMsg.Subject = txtMsgSubject.Text;

                            // Set HTMLBody.
                            string currdispatches = "";
                                //SQL Function Example
                            SqlCommand cmddispatch = new SqlCommand("select dbo.CustomerDispatchDated(@shipdate,@ac_code,@fromid,@uptoid)", con);
                            cmddispatch.CommandType = CommandType.Text;
                            cmddispatch.Parameters.Add(new SqlParameter("@shipdate", dtpDispatchedOn.Value.ToString("yyyyMMdd")));
                            cmddispatch.Parameters.Add(new SqlParameter("@ac_code", LoadShdlVsDispData(dtr["ac_code"].ToString()).ToString()));
                            cmddispatch.Parameters.Add(new SqlParameter("@fromid", fromid));
                            cmddispatch.Parameters.Add(new SqlParameter("@uptoid", uptoid));

                            try
                            {
                                if (con.State == ConnectionState.Closed)
                                    con.Open();
                                currdispatches = (string)cmddispatch.ExecuteScalar();
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show(ex.ToString());
                            }

                            oMsg.HTMLBody = " Dispatched on:" + dtpDispatchedOn.Value.ToShortDateString()+
                            System.Environment.NewLine +
                            txtMsgBody.Text +
                            System.Environment.NewLine +
                            currdispatches+
                            System.Environment.NewLine +"Developed by:Sushil Agarwal (+91 98226 10809)";

                            // Add a recipient.
                            Outlook.Recipients oRecips = (Outlook.Recipients)oMsg.Recipients;
                            // TODO: Change the recipient in the next line if necessary.
                            string[] receipants = dtr["email_id"].ToString().Split(';');
                            for (int i = 0; i < receipants.Length; i++)
                            {
                                Outlook.Recipient oRecip = (Outlook.Recipient)oRecips.Add(receipants[i]);
                                oRecip.Resolve();

                            }
                            //Add CC
                            if (!string.IsNullOrWhiteSpace(txtCC.Text))
                            {
                                string[] Receipantscc = txtCC.Text.Split(';');
                                for (int i = 0; i < Receipantscc.Length; i++)
                                {
                                    Outlook.Recipient recipientCC = oRecips.Add(Receipantscc[i]);
                                    recipientCC.Type = (int)Outlook.OlMailRecipientType.olCC;
                                    recipientCC.Resolve();
                                }
                            }

                            //Add BCC
                            //if (!string.IsNullOrWhiteSpace(txtBCC.Text))
                            //{
                            //    Outlook.Recipient recipientBCC = oRecips.Add(txtCC.Text);
                            //    recipientBCC.Type = (int)Outlook.OlMailRecipientType.olBCC;
                            //    recipientBCC.Resolve();
                            //}

                            //now attached the file

                            if (!string.IsNullOrWhiteSpace(emailreport))
                            {
                                //Add an attachment.
                                String sDisplayName = "ScheduleVsDispatch";
                                int iPosition = (int)oMsg.Body.Length + 1;
                                int iAttachType = (int)Outlook.OlAttachmentType.olByValue;
                                Outlook.Attachment oAttach = oMsg.Attachments.Add(emailreport, iAttachType, iPosition, sDisplayName);
                            }
                            // Send.
                            //31.7.2016
                            oMsg.Send();

                            // Log off.
                            oNS.Logoff();

                            // Clean up.
                            //oRecip = null;
                            oRecips = null;
                            oMsg = null;
                            oNS = null;
                            oApp = null;
                            if (!string.IsNullOrWhiteSpace(emailreport))
                                File.Delete(emailreport);

                            //Direct email without outllok usinh gmail sender example
                            //Attachment attachCh = new Attachment(emailreport, MediaTypeNames.Application.Octet);
                            //myMail.Attachments.Add(attachCh);
                            //myMail.To.Add(dtr["email_id"].ToString());
                            //smtpcl.Send(myMail);
                            //myMail.To.Clear();
                            //myMail.Attachments.Clear();
                        }

                        if (pgbEmail.Value == pgbEmail.Maximum)
                        {
                            pgbEmail.Value = pgbEmail.Minimum;
                        }
                        else
                        {
                            //pgbEmail.Value += 1;
                            pgbEmail.PerformStep();
                        }
                    }
                    // email attachemnt delete is not working error:use by another process, unsolved till :25.8.2011 san
                    //myMail.Attachments.Dispose();
                    //foreach (DataRow dtr in dtAl.Rows)
                    //{
                    //    string filename = Path.Combine(Path.GetTempPath(), dtr["short_name"].ToString() + "-" + scheduleperiod + "-ShdlVsDisp.pdf");
                    //    if (File.Exists( filename))
                    //        File.Delete(filename );
                    pgbEmail.Value = 100;
                    MessageBox.Show("e-mails Sent");
                    pgbEmail.Value = pgbEmail.Minimum;
                }
            }
            catch (ReportViewerException ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
private string ExportShdlVsDisp(LocalReport lr, string filename = "scheduleVSdispatch", string fileExt="PDF" )
        {
            Warning[] warnings;
            string[] streamids;
            string mimeType;
            string encoding;
            string filenameExtension="";
            string outfilename = Path.Combine(Path.GetTempPath(), filename);
            //byte[] bytes1 = lr.Render("Excel",null,out mimeType,out encoding,out filenameExtension,out streamids,out warnings);

            try
            {
                byte[] bytes = lr.Render(fileExt, null, out mimeType, out encoding, out filenameExtension, out streamids, out warnings);
                using (FileStream fs = new FileStream(outfilename + "." + filenameExtension, FileMode.Create))
                {
                    fs.Write(bytes, 0, bytes.Length);
                }

            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.ToString());
            }

            if (string.IsNullOrWhiteSpace(filenameExtension))
                return "";
            else
                return outfilename + "." + filenameExtension;
        }

Given path's format is not supported. Reporting Services

$
0
0

Hi

I am getting following Error in Subscription of Reporting Services.

Failure writing file \\ServerName\Reports_SQL2012\FolderName\name.pdf : The given path's format is not supported.

Where have I done wrong? Please advise.

Thanks,

Compare results for current day and same day last year in SSRS Dataset Query

$
0
0

I have a main report and a subreport, the main report shows results for each day of the current month/year. I would lie for the subreport to display the same day for the previous year. Not the same date, but the day of the week. Therefore I would be comparing a Monday to a Monday, a Tuesday to a Tuesday, etc. I am looking for an example of a Where clause that would give me those results in my Subreport. I have the logic worked out for the main report. The image below is an example of what I currently have. The main report results are on the left, the subreport on the right. You can see that currently I am comparing a Friday to a Wednesday for the July 1 2016 versus July 1 2015. I would like to be comparing Friday July 1, 2016 to Friday July 3, 2015.

Dynamic Color change for group based on parameter

$
0
0

Hi,

I have to change the color of row groups based on the parameter selected. It is a multi-value parameter.

If i select parameter1 and parameter2, then the groups associated with these parameters have to be filled with different colors.

If i add parameter3, then group associated with that parameter should have different color.

Please give me any suggestions.

Viewing all 20764 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>