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

Can't change Internal Parameter to hidden

$
0
0
I have a parameter for the User credentials and have the default value to the built in field User!UserID or [&UserID]. I want to utilize the drill through features of these reports and often times, pass in a user id that is not necessarily the same as the current user. However, if no user is passed in I want it to default to the built in current user field. When I go to drill into my report it says 'The report parameter 'UserID' is read-only and cannot be modified.' I assume this is because the parameter is internal but when I go to change it to hidden and save the report it switches right back to internal no error or anything it just switches back. 

Sort by top 5% for Top 5 largest values

$
0
0

I am trying to pull the Top 5 largest values from the Principal.  I need to do it for each year that is displaying.  Some may have up to 20 or 30 years.   I have tried the filter in the Groups, but this doesn't seem to work.  I need all the top 5 for 2019 , top 5 for 2020 etc.

Thank you.

Refresh Dictionary Values

$
0
0

Hello, 

Due to the nature of my grouping and using a CSV as oneof my datasource I have needed to use custom code to sum values. 

My custom code is a nested dictionary that stores the totals of various groups. 

The issue I'm having now is that whenever I re-run the report the dictionary is not reset to it's initial state, so it will continue to sum values. So if you run the same report with same values twice it will return the values * 2. 

Is there anyway to run a function so that whenever the view report button is pressed a function will run? 

Access Denied when Printing/Publishing

$
0
0

I pushed a update to my staging server that updated our report viewer control from a dinasour version to the latest version.

The reports all show up fine but when clicking on print or export the user gets a error such as the one shown below -

Access Denied
You don't have permission to access "http://website.com/staging/Reserved.ReportViewerWebControl.axd?" on this server.

Reference #18.d6430d6.1563384398.98984d

______________

A hack I did that makes it work - A changed URL that gives the error -

https://mywebsite/staging/oldsite/Reserved.ReportViewerWebControl.axd?ReportSession=4pkobe55ntryhl45db1u1q45&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=2c6c83b9ac5543fdb1b0211a26f9d5f5&RSProxy=http%3a%2f%2f123.456.789%2freportserver&OpType=Export&FileName=Readiness&ContentDisposition=OnlyHtmlInline&Format=PDF

Take note of the RSProxy=http%3a%2f%2f123.456.789%2freportserver line. If I remove that line from the URL it works without issue. Obviously its not a acceptable solution to tell my users that they have to remove a line from a URL to get something to work. Is there a way to remove this proxy parameter from the print/export option so it works as intended?


Some additional information:

My website is served through HTTPS only. The report server is served off HTTP.
The print/export function works when I run it on my personal development site. Both sites hit the same webserver.
We use IIS8.

I tried looking at the configuration of the report server and my IIS but I can't find anything that would lead to this issue. Any ideas?

Get a subtotal into a textbox

$
0
0

Hi All,

I created a report in SSRS with subtotals by categories. 

Basically each user sells 2 categories of goods.

On the report, we have the subtotals per category and a grand total.

I am trying to copy the subtotal per category in a separate textbox on the same report so the users does not have to scroll all the way down to see his subtotal. 

I am trying to use the expression but I am not getting anywhere. 

Have any of you ever done that?

Let me know if you have any questions

Sort Groups from a Parameter

$
0
0

I added a parent group to my table. Those parent groups mostly contain only one details row. I want to sort by a detail field, but not withing the groups, rather sorting the groups using the one (or highest) value it has in the given detail field. I can do this using 'interactive sorting' in the properties of a textBox, but how would I do it using a parameter?

Thanks

Approach for calling stored procedure from SSRS report that includes multiple results

$
0
0

Need to build a report for a sql statement that returns several different results.  I know this is a problem for ssrs, so I want to spit up the procedure into multple procedures, one per dataset to be used by the report.  The problem is that several template tables are used that more than one result depends on.

So if there say, 4 procedures used by this report, can one include the statements that handle the temp table creation, and then the last in the chain call the "cleanup" of any temp tables being used ?

eg.

IF OBJECT_ID('tempdb..#Results')ISNOTNULLDROPTABLE#Results

The problem is that you dont know in which order the datasets get populated.

Page can't be displayed everytime I try to access Report server from another computer

$
0
0

Good day!

I have this problem, I have set up a Report Server, everything is fine when I use it locally, but when I try to access it in another computer, it's always "Page can't be displayed" here's the things that I have done:

  • pinging the server from the client, all clear
  • opening the port for report server, clear
  • added the Report Server URL in the trusted sites
  • configure the .config file of report server in different authentication

but to no avail, still all other computer with in the local network can't access the report server.

PS. I am using SSRS 2014


Return Specific Values From Multivalue Parameters

$
0
0

Hello, 

I'd like to be able to return a specific subset of values from a multi-value parameter. 

Currently I have SQL which makes use of LIKE to group together certain customers who share a certain prefix, this is only done for this customer as whilst each part is needed to look at accounts when analysing this data we need to see them all together. 

So my SQL will turn ABC1, ABC2,ABC3 into ABC-ALL. 

Now within SSRS I can get this to show correctly, but when I drill down into a detail report for the customer ABC-ALL I need to be able to get all the values ABC1,ABC2,ABC3 back. Now these values are stored within a multi-value parameter named Customer, but this also contains all of the other customer values. 

Is there a way to do something like: 

IIF(Fields!CustomerAccountNumber.Value = 'ABC-ALL', 
Return Like 'ABC' FROM Parameters!Customer.Value, 'THEN Should only return values with ABC prefix
Fields!CustomerAccountNumber) 'Should return single value handled by SSRS grouping

Multi-Value Parameter Type

$
0
0

I was just wondering if anyone knew what type a Multi-Value parameter is within SSRS. So by this I mean when you Right Click a parameter and have "Allow Multiple Values" what does that return?

A list, an array, an arrayList?

I'm having some trouble using one of these values within a custom code function and just want to make sure I'm passing it as the correct type. 

Mobile Reports for Public Website

$
0
0

Hi,

I am looking at designing a Mobile report and integrating it into a customer facing website that is written ASP.NET MVC.  The customer logs in with an email address that is stored in a SQL database and associated with 1 or more Customer ID's via a Parent Child Relationship.  The data source for the report pulls from a reporting database that contains all of our customer data so I only need to load the dashboard data for the specific customer logging in.  Is this possible to do and lock down the dashboard so the customer cannot change and view others customer data?

Thanks

Test connection failing

$
0
0

Hi

No matter what I enter, I cannot get a connection to the database.

In Visul Studio I created a small project called 'Tutorial' which contains a single Microsoft RDL report.
I created a datasource and a dataset and can preview my report in Visual Studio 2017.
I deployed all three to the ReportServer [running on the same machine] and can see the three directories - Datasets, Data Sources and Tutorial.
I set up my 'Current Report Server Database' in the Report Server Configuration Manager and selected 'Windows Credentials' for my authentication type with a username of LAPTOP-########\MyAccountName and my laptop password.
I did the same for the 'Current repprt Server Database Credential'.
My 'Data Source Properties' credentials is also 'Use Windows Authentication'.

In 'SQL Server Reporting Services' I select 'Using the following credentials' and enter the same login credentials I did in the Report Server Configuration Manager.

I click 'Test connection' and get ...

Couldn't connect - The report server couldn't connect to the data source using the information you entered. Make sure you've entered the connection string and any credentials correctly.

My connection string in 'SQL Server Reporting Services' is:
Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=AdventureWorks2016;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False

If anyone has any suggestions, it would be greatly appreciated.

Thanks

Failure writing file : The network path was not found.

$
0
0

Hi Team,

Have created a ssrs windows file share subscription and am getting bellow error message

Failure writing file \\Users\balan\Documents\Fare\Fare2019_07_22_114541.xlsx : The network path was not found.


Thanks Bala Narasimha

While exporting PDF from SSRS Report getting error as Error

$
0
0
While exporting PDF from SSRS Report getting error as Error: Try this action again. If the problem continues, check the Microsoft Dynamics CRM Community for solutions or contact your organization's Microsoft Dynamics CRM Administrator. Finally, you can contact Microsoft Support.

Apply same formatting to Textbox (report title) to All ssrs reports in solution /multiple solutions

$
0
0

Hi All,

I am not sure is this proper forum to ask. I have multiples solutions for SSRS reports in Visual Studio 2016/17. I am required to modify formatting values (font size and txt color) for all the reports in all the solutions with same value to make it standard. Is there any way I can achieve this in one go (or with least amount of effort  rather than opening each report and modify one by one.)

Thanks


SSRS-Print: We'll create a printer-friendly PDF version of your report

$
0
0

SQL Server 2016:

When clicking on the print button in the report, we get a pop-up with the text: We'll create a printer-friendly PDF version of your report:

We would like to skip this pop-up and, when clicking on the print button, go diretly to the print-window with the printers we can choose.

Does anyone have a tip on how to set this up?


SSRS deployment without ReportViewer.msi?

$
0
0

Hello,

i develop a WinForms application that shall use SSRS for reporting. The reports will be created on the client. Installing software components like ReportViewer.msi would trigger a complicated procedure in my customer's IT department. So I would like to avoid that. Is there a way to use SSRS in a WinForms application without having to install ReportViewer.msi?

Table headers disappear from last page depending on field size

$
0
0

Hello,

Report consists of 1 table. Structured this way

Outlined red headers set to 'KeepWithGroup'=After and 'RepeatOnNewPage'=True.

When report runs, all report pages have the red outlined headers present except sometimesthey are missing on last page. Trying to figure out why, I determined, that it depends on one of the report fields in  Group1. This field have nvarchar(MAX) size in SQL Server and could be a very big block of text. 

The report will show red outlined headers on last page when text in this field trimmed to 238 characters.When longer than 238 characters - headers disappear from last page only. 

This is very strange and makes report incomplete. I tried many ways to resolve this and could not. 

Can someone please help to resolve this?


SSRS Service Header - canot implicity convert type Execution Header to SOAP execution Header

$
0
0

Must be an easy fix.  I am having problems with the render portion.  Am I calling the wrong type?
below is a class built-out for an asp.net website to silently print.

Error and Code below.

Error

using System;
using System.Drawing.Printing;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Security.Principal;
using Microsoft.Reporting.WebForms;

namespace DirectlyPrintReport
{
    public class PrintManager
    {

        // class members 
        private Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.ReportExecutionService rs = new Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.ReportExecutionService();
        private byte[][] m_renderedReport;
        private Graphics.EnumerateMetafileProc m_delegate = null;
        private MemoryStream m_currentPageStream;
        private Metafile m_metafile = null;
        private int m_numberOfPages;
        private int m_currentPrintingPage;
        private int m_lastPrintingPage;

        public PrintManager()
        {
            rs.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
        }

        public PrintManager(System.Net.NetworkCredential credentials)
        {
            rs.Credentials = credentials;
        }
        public bool PrintReport(string reportPath, rsExecService.ParameterValue[] parameters, int fromPage, int toPage)
        {
            this.m_renderedReport = this.RenderReport(reportPath, parameters);
            try
            {
                // Wait for the report to completely render.
                if (m_numberOfPages < 1)
                {
                    return false;
                }

                //You can set the Required Printer Settings(Paper Size, Page Source, Orientation etc) in printerSettings object defined below
                PrinterSettings printerSettings = new PrinterSettings();
                printerSettings.MaximumPage = m_numberOfPages;
                printerSettings.MinimumPage = 1;
                printerSettings.PrintRange = PrintRange.AllPages;//PrintRange.SomePages;

                PrintDocument pd = new PrintDocument();
                if (toPage != -1 && fromPage != -1)
                {
                    m_currentPrintingPage = fromPage;
                    m_lastPrintingPage = toPage;
                    if (m_numberOfPages < toPage)
                    {
                        toPage = m_numberOfPages;
                        m_lastPrintingPage = toPage;
                    }
                    if (m_numberOfPages < fromPage)
                    {
                        fromPage = m_numberOfPages;
                        m_currentPrintingPage = fromPage;
                    }
                    printerSettings.FromPage = fromPage;
                    printerSettings.ToPage = toPage;

                    Console.WriteLine("Printing report... Start Page:{0} End Page:{1} Total Page(s):{2}", fromPage, toPage, m_numberOfPages);
                }
                else
                {
                    m_currentPrintingPage = 1;
                    m_lastPrintingPage = m_numberOfPages;
                    Console.WriteLine("Printing report...");
                }
                using (WindowsImpersonationContext wic = WindowsIdentity.Impersonate(IntPtr.Zero))
                {
                    //code to send printdocument to the printer
                    //Set Your Printer Name here
                    printerSettings.PrinterName = "Microsoft XPS Document Writer";
                    pd.PrinterSettings = printerSettings;
                    pd.PrintPage += this.pd_PrintPage;

                    pd.Print();
                }
            }
            catch (Exception ex)
            {
                //System.Windows.Forms.MessageBox.Show(ex.ToString());
                Console.WriteLine(ex.Message);
            }
            return true;
        }



        /// <summary>
        /// This method renders the report as multidimentional byte array.
        /// </summary>
        private byte[][] RenderReport(string reportPath, rsExecService.ParameterValue[] parameters)
        {
            // Private variables for rendering
            string historyId = null;
            rsExecService.ExecutionHeader execHeader = new rsExecService.ExecutionHeader();

            try
            {
                rs.Timeout = 300000;
                //https://docs.microsoft.com/en-us/dotnet/api/reportexecution2005.reportexecutionservice.render?view=sqlserver-2016
                rs.ExecutionHeaderValue = execHeader;
                rs.LoadReport(reportPath, historyId);
                if ((parameters != null))
                {
                    rs.SetExecutionParameters(parameters, "en_us");
                }


                byte[][] pages = new Byte[0][];
                string format = "IMAGE";
                int numberOfPages = 1;
                byte[] currentPageStream = new byte[1] { 0x00 }; // put a byte to get the loop started
                string extension = null;
                string encoding = null;
                string mimeType = null;
                string[] streamIDs = null;
                rsExecService.Warning[] warnings = null;

                while (currentPageStream.Length > 0)
                {
                    string deviceInfo = String.Format(@"<DeviceInfo><OutputFormat>EMF</OutputFormat><PrintDpiX>200</PrintDpiX><PrintDpiY>200</PrintDpiY>" + "<StartPage>{0}</StartPage></DeviceInfo>", numberOfPages);
                    //rs.Render will render the page defined by deviceInfo's <StartPage>{0}</StartPage> tag
                    currentPageStream = rs.Render(format, deviceInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);

                    if (currentPageStream.Length == 0 && numberOfPages == 1)
                    {
                        //renderException = EnumRenderException.ZERO_LENGTH_STREAM;
                        break;
                    }

                    //Add the byte stream of current page in pages[] array so that we can have complete report in pages[][] array
                    if (currentPageStream.Length > 0)
                    {
                        Array.Resize(ref pages, pages.Length + 1);
                        pages[pages.Length - 1] = currentPageStream;
                        numberOfPages++;
                    }
                }

                m_numberOfPages = numberOfPages - 1;

                return pages;
            }
            catch (System.Web.Services.Protocols.SoapException ex)
            {
                Console.WriteLine(ex.Detail.InnerXml);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            finally
            {
                // Console.WriteLine("Number of pages: {0}", pages.Length);
            }
            return null;
        }



        /// <summary>
        /// Handle the Printing of each page
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="ev"></param>
        private void pd_PrintPage(object sender, PrintPageEventArgs ev)
        {
            ev.HasMorePages = false;
            if (m_currentPrintingPage <= m_lastPrintingPage && MoveToPage(m_currentPrintingPage))
            {
                // Draw the page
                ReportDrawPage(ev.Graphics);
                // If the next page is less than or equal to the last page,
                // print another page.
                if (System.Threading.Interlocked.Increment(ref m_currentPrintingPage) <= m_lastPrintingPage)
                {
                    ev.HasMorePages = true;
                }
            }
        }



        // Method to draw the current emf memory stream
        private void ReportDrawPage(Graphics g)
        {
            if (m_currentPageStream == null || 0 == m_currentPageStream.Length || m_metafile == null)
            {
                return;
            }
            lock (this)
            {
                // Set the metafile delegate.
                int width = m_metafile.Width;

                int height = m_metafile.Height;
                m_delegate = new Graphics.EnumerateMetafileProc(MetafileCallback);
                // Draw in the rectangle
                //Point destPoint = new Point(0, 0);
                Point[] points = new Point[3];
                Point destPoint = new Point(0, 0);
                Point destPoint1 = new Point(width / 2, 0);
                Point destPoint2 = new Point(0, height / 2);

                points[0] = destPoint;
                points[1] = destPoint1;
                points[2] = destPoint2;
                g.EnumerateMetafile(m_metafile, points, m_delegate);
                // Clean up
                m_delegate = null;
            }
        }



        private bool MoveToPage(int page)
        {
            // Check to make sure that the current page exists in
            // the array list
            if (m_renderedReport[m_currentPrintingPage - 1] == null)
            {
                return false;
            }
            // Set current page stream equal to the rendered page
            m_currentPageStream = new MemoryStream(m_renderedReport[m_currentPrintingPage - 1]);
            // Set its postion to start.
            m_currentPageStream.Position = 0;
            // Initialize the metafile
            if (m_metafile != null)
            {
                m_metafile.Dispose();
                m_metafile = null;
            }
            // Load the metafile image for this page
            m_metafile = new Metafile((Stream)m_currentPageStream);
            return true;
        }



        private bool MetafileCallback(EmfPlusRecordType recordType, int flags, int dataSize, IntPtr data, PlayRecordCallback callbackData)
        {
            byte[] dataArray = null;
            // Dance around unmanaged code.
            if (data != IntPtr.Zero)
            {
                // Copy the unmanaged record to a managed byte buffer
                // that can be used by PlayRecord.
                dataArray = new byte[dataSize];
                Marshal.Copy(data, dataArray, 0, dataSize);
            }
            // play the record.
            m_metafile.PlayRecord(recordType, flags, dataSize, dataArray);
            return true;
        }
    }



Claudia


SSRS Email Setting TLS 1.2

$
0
0

We have been using SSRS 2016 email sending for a long time with no issues.  I just received a notice from Microsoft that the email is being sent using TLS 1.0 and must be changed to TLS 1.2 before September 30th or we will no longer be able to send via our Office 365 account.  I have searched for answers on how to force TLS 1.2 using SSRS email sending and have found nothing.

Has anyone had to deal with this?  If so, any thoughts on how to fix it?

Thanks.

John

Viewing all 20764 articles
Browse latest View live


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