CrystalReportViewer TabPages BackColor

Hello,
Is it possible to change TabPage BackColor of CrystalReportViewer since subreport is loading.
I'm able to change BackColor using such code
foreach (Control control in viewer.Controls)
                if (control is PageView)
                    System.Windows.Forms.TabControl tab = (System.Windows.Forms.TabControl)((PageView)control).Controls[0];
                        for (int i = 0; i < tab.TabPages.Count; i++)
                            tab.TabPages<i>.BackColor = Color.FromArgb(157, 188, 227);
                            tab.TabPages<i>.ForeColor = Color.FromArgb(157, 188, 227);
but when I click on link of the subreport (I use On-demand Subreport) second TabPage has default color. I try to change that while crystalReportViewer_DrillDownSubreport rising but TabPages is not created yet. Is there any solution for that?
I use Crystal Reports Basic for Visual Studio 2008.
Regards,
Sebastian

The way that I found that I could change the gray background that is around the report page was by using the crystalReportViewer_Layout method.  This method is called all the time, so you may want to use a flag that you set on the drilldown, and unset at the end of the Layout method. 
Additionally, if you are trying to set the tab at the top of the page color, this is not possible as it is a limitation of the .NET object that is used.

Similar Messages

  • CrystalReportViewer 2008 does not release GDI objects after closing.

    We need help in resolving an issue with a WinForms application we have developed that makes use of the Crystal Reports 2008 viewer control to both generate reports based on various parameters the user supplies and to view these same reports having been previously saved in crystal 2008 format.
    The issue we are seeing is that GDI objects are being created during the report generation process but some are not being released when the report viewer window is closed down. This leads to the system running out of GDI objects (seen by using the Windows task manager) and ultimately the application crashes. It is only when the application is closed completely that GDI resources are returned to the system.
    In an effort to isolate the cause of this problem we created a much simplified WinForms application that simply allowed us to systematically open and close a WinForm  that contains a CrystalReportViewer  to display one of our example reports. We found that the behaviour is the same for this application too.
    Browsing the crystal reports forums reveals there have been a few questions about u201Cmemory leaksu201D like this (see "Thread: CrystalReportViewer memory usage increases until out of memory" as an example) and there has been a good deal of talk about manually "disposing" of report documents and viewers but trying this does not correct this issue
    The extent of the "GDI Object leak" does depend upon the kind of report that is pulled in. One report we have that is 360 pages long and contains graphs and tables of data leaks 390 object per test iteration.
    Is this a known issue with the Crystal Report Viewer and if so is there an update or a workaround available?
    Are we performing all the correct initialisation prior to using the viewer? For example we are supplying the report to the viewer through a ReportDocument object; is there something special we need to do with that?
    Do we have to do anything special when closing the viewer?
    Could it be to do with the design of our reports? We are using the Crystal Reports 2008 editor (sp1) to do this design.
    We urgently need to help in understanding why this is happening and to be able implement a solution that will address this problem.
    I have provided the following code snippets of this sample application to give a flavour of what we are doing and hopefully you can see that it is not complex. The example shows the crystal viewer being presented with a ReportDocument as a Report Source ... this is how our proper application does things but if you try supplying the filename of the crystal report directly, the problem is the same.
    This C# code was written using Visual Studio 2008.
    // ===================================================================================
    //                                                  Sample Code Snippets  
    // ===================================================================================
        static class Program
            /// <summary>
            /// The main entry point for the application.
            /// </summary>
            [STAThread]
            static void Main()
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new MDIParent1());
    // ===================================================================================
    // ===================================================================================
        public partial class MDIParent1 : Form
            private int childFormNumber = 0;
            public MDIParent1()
                InitializeComponent();
            private void ShowNewForm(object sender, EventArgs e)
                Form childForm = new TestForm();
                childForm.MdiParent = this;
                childForm.Text = "Window " + childFormNumber++;
                childForm.Show();
            private void OpenFile(object sender, EventArgs e)
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                openFileDialog.Filter = "Text Files (.txt)|.txt|All Files (.)|.";
                if (openFileDialog.ShowDialog(this) == DialogResult.OK)
                    string FileName = openFileDialog.FileName;
            private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
                SaveFileDialog saveFileDialog = new SaveFileDialog();
                saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                saveFileDialog.Filter = "Text Files (.txt)|.txt|All Files (.)|.";
                if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
                    string FileName = saveFileDialog.FileName;
            private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
                this.Close();
            private void CutToolStripMenuItem_Click(object sender, EventArgs e)
            private void CopyToolStripMenuItem_Click(object sender, EventArgs e)
            private void PasteToolStripMenuItem_Click(object sender, EventArgs e)
            private void ToolBarToolStripMenuItem_Click(object sender, EventArgs e)
                toolStrip.Visible = toolBarToolStripMenuItem.Checked;
            private void StatusBarToolStripMenuItem_Click(object sender, EventArgs e)
                statusStrip.Visible = statusBarToolStripMenuItem.Checked;
            private void CascadeToolStripMenuItem_Click(object sender, EventArgs e)
                LayoutMdi(MdiLayout.Cascade);
            private void TileVerticalToolStripMenuItem_Click(object sender, EventArgs e)
                LayoutMdi(MdiLayout.TileVertical);
            private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e)
                LayoutMdi(MdiLayout.TileHorizontal);
            private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e)
                LayoutMdi(MdiLayout.ArrangeIcons);
            private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
                foreach (Form childForm in MdiChildren)
                    childForm.Close();
    // ===================================================================================
    // ===================================================================================
        public partial class TestForm : Form
            private ReportDocument crDocument;
            public TestForm()
                InitializeComponent();
            private void TestForm_Load(object sender, EventArgs e)
                crDocument = new ReportDocument();
                crDocument.Load(@"C:\Reports\Sample1.rpt");
                this.crystalReportViewer1.ReportSource = crDocument;
    //            this.crystalReportViewer1.ReportSource = @"C:\Reports\Sample1.rpt";
            private void TestForm_FormClosing(object sender, FormClosingEventArgs e)
                this.crDocument.Dispose();
    // ===================================================================================

    Hi Martyn,
    I tested this and found after using this code to re-initialize the report viewer there we still 400 GDI objects not getting released. This may or may not be a CR issue. Still testing.
    Try this also, I simply created a close button but you should be able to do this in your form close method also depending on how you do it:
            private void CloseReport_Click(object sender, EventArgs e)
                rptClientDoc.Close();
                crystalReportViewer1.Dispose();
                GC.Collect();
                this.crystalReportViewer1 = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
                InitializeComponent();
                crystalReportViewer1.ShowExportButton = true;
                crystalReportViewer1.EnableRefresh = true;
                crystalReportViewer1.Controls.Count.ToString();
                crystalReportViewer1.BackColor.IsNamedColor.ToString();
                crystalReportViewer1.EnableToolTips = true;
                crystalReportViewer1.Refresh();
    The issue has now been tracked - Problem_Report:  ADAPT01301248
    Thanks again
    Don
    Edited by: Don Williams on Sep 15, 2009 11:01 AM

  • Adding a new tab to CrystalReportViewer and loading a new rpt into it

    Hi,
    I've been struggling with the following problem for a few days now and I would really appreciate any help you can offer.
    I need to add a new tab to an existing instance of CrystalReportViewer and load a new crystal report (RPT) into it.
    I wasn't able to do that and tried inserting an instance of a new CrystalReportViewer into the new tabpage, but I've encountered several problems with that solution as well, such as: by hiding the tree and all bars, I'm also removing the page navigation field of the new rpt.
    Here is the code I've used:
    TabControl tabControl = (TabControl)((PageView)crystalReportViewer1.Controls[0]).Controls[0];
    DocumentControl tab2 = new DocumentControl(new ViewerDocument(new SubreportContext()));
    tabControl .Controls.Add(tab2);
    tabControl .TabPages[1].Text = "New Tab";
    tabControl .SelectedTab = tab.TabPages[1];
      Now I need to load the rpt to the new tabpage
    If I'm trying to add a new CrystalReportViewer into the tabpage:
    ReportDocument oRpt2 = new ReportDocument();
    oRpt2.Load(tempFile);
    CrystalReportViewer newViewer = new CrystalReportViewer();
    newViewer.Dock = DockStyle.Fill;
    newViewer.DisplayGroupTree = false;
      newViewer.DisplayStatusBar = false;
      newViewer.EnableDrillDown = false;
      newViewer.DisplayStatusBar = false;
      newViewer.DisplayToolbar = false;
      newViewer.ReportSource = oRpt2;
       tab2.Controls.Add(newViewer);
    Please let me know what is the best practice for this kind of operation.

    Continue my question....
    I've found a method that opens such a tab for me in one statement:
    DocumentControl tab2 = ((PageView)crystalReportViewer1.Controls[0]).CreateNewReportDocument("new doc");
    But I remain with question of how to load the new RPT into it?

  • CrystalReportViewer Toolbar

    Crystal report viewer Page navigation buttons issue
    <CR:CrystalReportViewer ID="uxViewer" runat="server" HasExportButton="False"  HasPrintButton="True"
                  EnableDatabaseLogonPrompt="false" EnableParameterPrompt="false" HasCrystalLogo="False" HasRefreshButton="False"
                  HasSearchButton="False" HasDrillUpButton="False" HasToggleGroupTreeButton="False"
                   Height="100" Width="100%" BackColor="White" HasPageNavigationButtons="True" HasZoomFactorList="False"
             />
    we were earlier using crystal reports 2005  with the above declaration and the crystal report viewer control looked like the first image in the below link.
    After migrating it to CR v13 with the below declaration, it looked like the second image in the below link
    <CR:CrystalReportViewer ID="uxViewer" runat="server" HasExportButton="False"  HasPrintButton="True"
                  EnableDatabaseLogonPrompt="false" EnableParameterPrompt="false" HasCrystalLogo="False" HasRefreshButton="False"
                  HasSearchButton="False" HasDrillUpButton="False" HasToggleGroupTreeButton="False"
                   Height="100" Width="100%" BackColor="White" HasPageNavigationButtons="True" HasZoomFactorList="False" EnableDrillDown="False"  ToolPanelView="None"
               HasDrilldownTabs="False"
             />
    [Above-2005 / Below V13 CRV toolbar|http://tinypic.com/r/rlcjtt/5]
    Is there a change in look and feel, or am I missing something here.

    You can control the toolbar via the viewer properties. E.g.; ShowPageNavigateButton, etc., etc.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Adding Icon and increasing width of tabpages to show the close button in a tabcontrol

    I have this code right now,
    Public Class FSMTabControl
    Inherits TabControl
    #Region "Declarations"
    Private _TextColour As Color = Color.FromArgb(255, 255, 255)
    Private _BackTabColour As Color = Color.FromArgb(54, 54, 54)
    Private _BaseColour As Color = Color.FromArgb(35, 35, 35)
    Private _ActiveColour As Color = Color.FromArgb(47, 47, 47)
    Private _BorderColour As Color = Color.FromArgb(30, 30, 30)
    Private _UpLineColour As Color = Color.FromArgb(0, 160, 199)
    Private _HorizLineColour As Color = Color.FromArgb(23, 119, 151)
    Private CenterSF As New StringFormat With {.Alignment = StringAlignment.Center, .LineAlignment = StringAlignment.Center}
    #End Region
    #Region "Properties"
    <Category("Colours")> _
    Public Property BorderColour As Color
    Get
    Return _BorderColour
    End Get
    Set(value As Color)
    _BorderColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property UpLineColour As Color
    Get
    Return _UpLineColour
    End Get
    Set(value As Color)
    _UpLineColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property HorizontalLineColour As Color
    Get
    Return _HorizLineColour
    End Get
    Set(value As Color)
    _HorizLineColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property TextColour As Color
    Get
    Return _TextColour
    End Get
    Set(value As Color)
    _TextColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property BackTabColour As Color
    Get
    Return _BackTabColour
    End Get
    Set(value As Color)
    _BackTabColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property BaseColour As Color
    Get
    Return _BaseColour
    End Get
    Set(value As Color)
    _BaseColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property ActiveColour As Color
    Get
    Return _ActiveColour
    End Get
    Set(value As Color)
    _ActiveColour = value
    End Set
    End Property
    Protected Overrides Sub CreateHandle()
    MyBase.CreateHandle()
    Alignment = TabAlignment.Bottom
    End Sub
    #End Region
    #Region "Draw Control"
    Sub New()
    SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or _
    ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer, True)
    DoubleBuffered = True
    Font = New Font("Segoe UI", 10)
    SizeMode = TabSizeMode.FillToRight
    ItemSize = New Size(240, 32)
    End Sub
    Protected Overrides Sub OnPaint(e As PaintEventArgs)
    Dim g = e.Graphics
    With G
    .SmoothingMode = SmoothingMode.HighQuality
    .PixelOffsetMode = PixelOffsetMode.HighQuality
    .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
    .Clear(_BaseColour)
    Try : SelectedTab.BackColor = _BackTabColour : Catch : End Try
    Try : SelectedTab.BorderStyle = BorderStyle.FixedSingle : Catch : End Try
    .DrawRectangle(New Pen(_BorderColour, 2), New Rectangle(0, 0, Width, Height))
    For i = 0 To TabCount - 1
    Dim Base As New Rectangle(New Point(GetTabRect(i).Location.X, GetTabRect(i).Location.Y), New Size(GetTabRect(i).Width, GetTabRect(i).Height))
    Dim BaseSize As New Rectangle(Base.Location, New Size(Base.Width, Base.Height))
    If i = SelectedIndex Then
    .FillRectangle(New SolidBrush(_BaseColour), BaseSize)
    .FillRectangle(New SolidBrush(_ActiveColour), New Rectangle(Base.X + 1, Base.Y - 3, Base.Width, Base.Height + 5))
    .DrawString(TabPages(i).Text, Font, New SolidBrush(_TextColour), New Rectangle(Base.X + 7, Base.Y, Base.Width - 3, Base.Height), CenterSF)
    .DrawLine(New Pen(_HorizLineColour, 2), New Point(Base.X + 3, CInt(Base.Height / 2 + 2)), New Point(Base.X + 9, CInt(Base.Height / 2 + 2)))
    .DrawLine(New Pen(_UpLineColour, 2), New Point(Base.X + 3, Base.Y - 3), New Point(Base.X + 3, Base.Height + 5))
    Else
    .DrawString(TabPages(i).Text, Font, New SolidBrush(_TextColour), BaseSize, CenterSF)
    End If
    Next
    .InterpolationMode = InterpolationMode.HighQualityBicubic
    End With
    End Sub
    Private Declare Auto Function SetParent Lib "user32" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
    Protected CloseButtonCollection As New Dictionary(Of Button, TabPage)
    Private _ShowCloseButtonOnTabs As Boolean = True
    <Browsable(True), DefaultValue(True), Category("Behavior"), Description("Indicates whether a close button should be shown on each TabPage")> _
    Public Property ShowCloseButtonOnTabs() As Boolean
    Get
    Return _ShowCloseButtonOnTabs
    End Get
    Set(ByVal value As Boolean)
    _ShowCloseButtonOnTabs = value
    For Each btn In CloseButtonCollection.Keys
    btn.Visible = _ShowCloseButtonOnTabs
    Next
    RePositionCloseButtons()
    End Set
    End Property
    Protected Overrides Sub OnCreateControl()
    MyBase.OnCreateControl()
    RePositionCloseButtons()
    End Sub
    Protected Overrides Sub OnControlAdded(ByVal e As System.Windows.Forms.ControlEventArgs)
    MyBase.OnControlAdded(e)
    Dim tp As TabPage = DirectCast(e.Control, TabPage)
    Dim rect As Rectangle = Me.GetTabRect(Me.TabPages.IndexOf(tp))
    Dim btn As Button = AddCloseButton(tp)
    btn.Size = New Size(CInt(rect.Height / 2), CInt(rect.Height / 2))
    btn.Location = New Point(rect.X + rect.Width - rect.Height + 11, CInt(rect.Y + 7))
    SetParent(btn.Handle, Me.Handle)
    AddHandler btn.Click, AddressOf OnCloseButtonClick
    CloseButtonCollection.Add(btn, tp)
    End Sub
    Protected Overrides Sub OnControlRemoved(ByVal e As System.Windows.Forms.ControlEventArgs)
    Dim btn As Button = CloseButtonOfTabPage(DirectCast(e.Control, TabPage))
    RemoveHandler btn.Click, AddressOf OnCloseButtonClick
    CloseButtonCollection.Remove(btn)
    SetParent(btn.Handle, Nothing)
    btn.Dispose()
    MyBase.OnControlRemoved(e)
    End Sub
    Protected Overrides Sub OnLayout(ByVal levent As System.Windows.Forms.LayoutEventArgs)
    MyBase.OnLayout(levent)
    RePositionCloseButtons()
    End Sub
    Public Event CloseButtonClick As CancelEventHandler
    Protected Overridable Sub OnCloseButtonClick(ByVal sender As Object, ByVal e As EventArgs)
    If Not DesignMode Then
    Dim btn As Button = DirectCast(sender, Button)
    Dim tp As TabPage = CloseButtonCollection(btn)
    Dim ee As New CancelEventArgs
    RaiseEvent CloseButtonClick(sender, ee)
    If Not ee.Cancel Then
    Me.TabPages.Remove(tp)
    RePositionCloseButtons()
    End If
    End If
    End Sub
    Protected Overridable Function AddCloseButton(ByVal tp As TabPage) As Button
    Dim closeButton As New Button
    With closeButton
    '' TODO: Give a good visual appearance to the Close button, maybe by assigning images etc.
    '' Here I have not used images to keep things simple.
    .Text = "X"
    .FlatStyle = FlatStyle.Flat
    .BackColor = _BaseColour
    .ForeColor = Color.White
    .Font = New Font("Microsoft Sans Serif", 6, FontStyle.Bold)
    End With
    Return closeButton
    End Function
    Public Sub RePositionCloseButtons()
    For Each item In CloseButtonCollection
    RePositionCloseButtons(item.Value)
    Next
    End Sub
    Public Sub RePositionCloseButtons(ByVal tp As TabPage)
    Dim btn As Button = CloseButtonOfTabPage(tp)
    If btn IsNot Nothing Then
    Dim tpIndex As Integer = Me.TabPages.IndexOf(tp)
    If tpIndex >= 0 Then
    Dim rect As Rectangle = Me.GetTabRect(tpIndex)
    If Me.SelectedTab Is tp Then
    btn.BackColor = Color.Red
    btn.Size = New Size(CInt(rect.Height / 2), CInt(rect.Height / 2))
    btn.Location = New Point(rect.X + rect.Width - rect.Height + 11, CInt(rect.Y + 7))
    Else
    btn.BackColor = _BaseColour
    btn.Size = New Size(CInt(rect.Height / 2), CInt(rect.Height / 2))
    btn.Location = New Point(rect.X + rect.Width - rect.Height + 11, CInt(rect.Y + 7))
    End If
    btn.Visible = ShowCloseButtonOnTabs
    btn.BringToFront()
    End If
    End If
    End Sub
    Protected Function CloseButtonOfTabPage(ByVal tp As TabPage) As Button
    Return (From item In CloseButtonCollection Where item.Value Is tp Select item.Key).FirstOrDefault
    End Function
    #End Region
    End Class
    This code shows a perfect tabcontrol as in the picture below,
    I managed to get this code working by combining three other VB themes I found. Right now, I just want to increase the width of the tab so the close button doesn't hides the text. And I want to add a icon to the left of the tab and be able to change it on
    runtime.
    The icons name will be on, off, 1, 2, plus .ico 
    Is it possible ? and is it possible to make the tabs curved at the corner like in chrome.

    Hi,
     I have went through your TabControl class and changed it around a little bit to get something similar to what i think you want.  I made it so that the Tabs are resized with the TabControl itself so that they always fill the width of the TabControl. 
    I also, made the Text of the tabs have its own rectangle which will automatically adjust it`s width according to weather or not the close buttons are shown so the text will never be under the buttons.
     As for the Icons, you could create another small class that inherits from the TabPage base class and add a public property to it for the Icon image.  You would have to use that class to add TabPages and set the Icon property.  Then in the
    TabControl class`s OnPaint overrides sub you would check if the Icon property of the TabPage is set and draw the image if it is.
     I didn`t go that far but, i used the TabPage`s Tag property for the Icon image.  Actually it is just an Image, not an Icon.  So, in the TabControl`s OnPaint overrides sub i check if the TabPage`s Tag property is set to an Image and if it
    is i adjust the Text rectangle to avoid the Image and draw the image.
     I moved the StringFormat to the OnPaint sub and set it to keep the text left aligned so it stayed next to the Image.  You can change it back to the Center if you want.  I also set the StringFormat trimming to EllipsisCharacter so it will
    cut the text off if it is to long to fit between the Image and the Close button.
     You can test it in a new form project first and to check out how it works and what i changed.
    Imports System.ComponentModel
    Imports System.Drawing.Drawing2D
    Imports System.Drawing.Text
    Public Class FSMTabControl
    Inherits TabControl
    #Region "Declarations"
    Private _TextColour As Color = Color.FromArgb(255, 255, 255)
    Private _BackTabColour As Color = Color.FromArgb(54, 54, 54)
    Private _BaseColour As Color = Color.FromArgb(35, 35, 35)
    Private _ActiveColour As Color = Color.FromArgb(47, 47, 47)
    Private _BorderColour As Color = Color.FromArgb(30, 30, 30)
    Private _UpLineColour As Color = Color.FromArgb(0, 160, 199)
    Private _HorizLineColour As Color = Color.FromArgb(23, 119, 151)
    #End Region
    #Region "Properties"
    <Category("Colours")> _
    Public Property BorderColour() As Color
    Get
    Return _BorderColour
    End Get
    Set(ByVal value As Color)
    _BorderColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property UpLineColour() As Color
    Get
    Return _UpLineColour
    End Get
    Set(ByVal value As Color)
    _UpLineColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property HorizontalLineColour() As Color
    Get
    Return _HorizLineColour
    End Get
    Set(ByVal value As Color)
    _HorizLineColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property TextColour() As Color
    Get
    Return _TextColour
    End Get
    Set(ByVal value As Color)
    _TextColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property BackTabColour() As Color
    Get
    Return _BackTabColour
    End Get
    Set(ByVal value As Color)
    _BackTabColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property BaseColour() As Color
    Get
    Return _BaseColour
    End Get
    Set(ByVal value As Color)
    _BaseColour = value
    End Set
    End Property
    <Category("Colours")> _
    Public Property ActiveColour() As Color
    Get
    Return _ActiveColour
    End Get
    Set(ByVal value As Color)
    _ActiveColour = value
    End Set
    End Property
    Protected Overrides Sub CreateHandle()
    MyBase.CreateHandle()
    Alignment = TabAlignment.Bottom
    End Sub
    #End Region
    #Region "Draw Control"
    Sub New()
    SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint Or ControlStyles.ResizeRedraw Or ControlStyles.OptimizedDoubleBuffer, True)
    DoubleBuffered = True
    Font = New Font("Segoe UI", 10)
    SizeMode = TabSizeMode.Fixed
    End Sub
    Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
    With e.Graphics
    .SmoothingMode = SmoothingMode.HighQuality
    .PixelOffsetMode = PixelOffsetMode.HighQuality
    .TextRenderingHint = TextRenderingHint.ClearTypeGridFit
    .Clear(_BaseColour)
    Try : SelectedTab.BackColor = _BackTabColour : Catch : End Try
    Try : SelectedTab.BorderStyle = BorderStyle.FixedSingle : Catch : End Try
    .DrawRectangle(New Pen(_BorderColour, 2), New Rectangle(0, 0, Width, Height))
    If Me.Created AndAlso Me.TabCount > 0 Then
    Dim tw As Integer = CInt(Me.ClientSize.Width / Me.TabCount)
    Dim offset As Integer = Me.TabCount
    If Me.ItemSize.Width <> tw - offset Then Me.ItemSize = New Size(tw - offset, 32)
    End If
    Using CenterSF As New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center, .Trimming = StringTrimming.EllipsisCharacter, .FormatFlags = StringFormatFlags.NoWrap}
    For i As Integer = 0 To TabCount - 1
    Dim Base As Rectangle = Me.GetTabRect(i)
    Dim txtrect As New Rectangle(Base.Left, Base.Top, Base.Width, Base.Height)
    Dim img As Image = Nothing
    If Me.TabPages(i).Tag IsNot Nothing Then
    txtrect.X += Base.Height
    txtrect.Width -= Base.Height
    img = DirectCast(Me.TabPages(i).Tag, Image)
    End If
    If ShowCloseButtonOnTabs Then
    txtrect.Width -= Base.Height
    End If
    If i = SelectedIndex Then
    .FillRectangle(New SolidBrush(_BaseColour), Base)
    .FillRectangle(New SolidBrush(_ActiveColour), New Rectangle(Base.X + 1, Base.Y - 3, Base.Width, Base.Height + 4))
    .DrawString(TabPages(i).Text, Font, New SolidBrush(_TextColour), txtrect, CenterSF)
    .DrawLine(New Pen(_HorizLineColour, 2), New Point(Base.X + 3, CInt(Base.Height / 2 + 2)), New Point(Base.X + 9, CInt(Base.Height / 2 + 2)))
    .DrawLine(New Pen(_UpLineColour, 2), New Point(Base.X + 3, Base.Y - 3), New Point(Base.X + 3, Base.Height + 5))
    Else
    .DrawString(TabPages(i).Text, Font, New SolidBrush(_TextColour), txtrect, CenterSF)
    End If
    If img IsNot Nothing Then
    .DrawImage(img, Base.Left + 2, Base.Top + 2, Base.Height - 4, Base.Height - 4)
    End If
    Next
    End Using
    .InterpolationMode = InterpolationMode.HighQualityBicubic
    End With
    End Sub
    Private Declare Auto Function SetParent Lib "user32" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
    Protected CloseButtonCollection As New Dictionary(Of Button, TabPage)
    Private _ShowCloseButtonOnTabs As Boolean = True
    <Browsable(True), DefaultValue(True), Category("Behavior"), Description("Indicates whether a close button should be shown on each TabPage")> _
    Public Property ShowCloseButtonOnTabs() As Boolean
    Get
    Return _ShowCloseButtonOnTabs
    End Get
    Set(ByVal value As Boolean)
    _ShowCloseButtonOnTabs = value
    For Each btn As Button In CloseButtonCollection.Keys
    btn.Visible = _ShowCloseButtonOnTabs
    Next
    RePositionCloseButtons()
    Me.Refresh()
    End Set
    End Property
    Protected Overrides Sub OnCreateControl()
    MyBase.OnCreateControl()
    RePositionCloseButtons()
    End Sub
    Protected Overrides Sub OnControlAdded(ByVal e As System.Windows.Forms.ControlEventArgs)
    MyBase.OnControlAdded(e)
    Dim tp As TabPage = DirectCast(e.Control, TabPage)
    Dim rect As Rectangle = Me.GetTabRect(Me.TabPages.IndexOf(tp))
    Dim btn As Button = AddCloseButton(tp)
    btn.Size = New Size(CInt(rect.Height / 2), CInt(rect.Height / 2))
    btn.Location = New Point(rect.X + rect.Width - rect.Height + 11, CInt(rect.Y + 7))
    SetParent(btn.Handle, Me.Handle)
    AddHandler btn.Click, AddressOf OnCloseButtonClick
    'ResizeTabs()
    CloseButtonCollection.Add(btn, tp)
    End Sub
    Protected Overrides Sub OnControlRemoved(ByVal e As System.Windows.Forms.ControlEventArgs)
    Dim btn As Button = CloseButtonOfTabPage(DirectCast(e.Control, TabPage))
    RemoveHandler btn.Click, AddressOf OnCloseButtonClick
    CloseButtonCollection.Remove(btn)
    SetParent(btn.Handle, Nothing)
    btn.Dispose()
    MyBase.OnControlRemoved(e)
    'ResizeTabs()
    End Sub
    Protected Overrides Sub OnLayout(ByVal levent As System.Windows.Forms.LayoutEventArgs)
    MyBase.OnLayout(levent)
    RePositionCloseButtons()
    End Sub
    Public Event CloseButtonClick As CancelEventHandler
    Protected Overridable Sub OnCloseButtonClick(ByVal sender As Object, ByVal e As EventArgs)
    If Not DesignMode Then
    Dim btn As Button = DirectCast(sender, Button)
    Dim tp As TabPage = CloseButtonCollection(btn)
    Dim ee As New CancelEventArgs
    RaiseEvent CloseButtonClick(sender, ee)
    If Not ee.Cancel Then
    Me.TabPages.Remove(tp)
    RePositionCloseButtons()
    End If
    End If
    End Sub
    Protected Overridable Function AddCloseButton(ByVal tp As TabPage) As Button
    Dim closeButton As New Button
    With closeButton
    '' TODO: Give a good visual appearance to the Close button, maybe by assigning images etc.
    '' Here I have not used images to keep things simple.
    .Text = "X"
    .FlatStyle = FlatStyle.Flat
    .BackColor = _BaseColour
    .ForeColor = Color.White
    .Font = New Font("Microsoft Sans Serif", 6, FontStyle.Bold)
    End With
    Return closeButton
    End Function
    Public Sub RePositionCloseButtons()
    For Each item As KeyValuePair(Of Button, TabPage) In CloseButtonCollection
    RePositionCloseButtons(item.Value)
    Next
    End Sub
    Public Sub RePositionCloseButtons(ByVal tp As TabPage)
    Dim btn As Button = CloseButtonOfTabPage(tp)
    If btn IsNot Nothing Then
    Dim tpIndex As Integer = Me.TabPages.IndexOf(tp)
    If tpIndex >= 0 Then
    Dim rect As Rectangle = Me.GetTabRect(tpIndex)
    If Me.SelectedTab Is tp Then
    btn.BackColor = Color.Red
    btn.Size = New Size(CInt(rect.Height / 2), CInt(rect.Height / 2))
    btn.Location = New Point(rect.Right - rect.Height + 11, CInt(rect.Y + 7))
    Else
    btn.BackColor = _BaseColour
    btn.Size = New Size(CInt(rect.Height / 2), CInt(rect.Height / 2))
    btn.Location = New Point(rect.Right - rect.Height + 11, CInt(rect.Y + 7))
    End If
    btn.Visible = ShowCloseButtonOnTabs
    btn.BringToFront()
    End If
    End If
    End Sub
    Protected Function CloseButtonOfTabPage(ByVal tp As TabPage) As Button
    Return (From item In CloseButtonCollection Where item.Value Is tp Select item.Key).FirstOrDefault
    End Function
    #End Region
    End Class
     In the Form`s code you can set the images for the TabPage icons like this.
    Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.TabPage1.Tag = Image.FromFile("C:\testfolder\img1.png")
    Me.TabPage2.Tag = Image.FromFile("C:\testfolder\img2.png")
    End Sub
    End Class
     Here is an example of what it looks like.
    If you say it can`t be done then i`ll try it
    Thanks :)) I tried you code and it works perfectly.
    Though i don't want the tabs have their width's by the size of form, so i fixed a width,
    If Me.Created AndAlso Me.TabCount > 0 Then
    'Dim tw As Integer = CInt(Me.ClientSize.Width / Me.TabCount)
    'Dim offset As Integer = Me.TabCount
    'If Me.ItemSize.Width <> tw - offset Then Me.ItemSize = New Size(tw - offset, 32)
    Me.ItemSize = New Size(200, 32)
    End If
    Here is the screenshot,
    I just don't know why the arrows (left and right) aren't full. here is a gif,
    Why is that :O Should I paint the arrows as well ?

  • Not able to view CrystalReportViewer in Azure Application.

    Hi All,
    We have an application which was developed in VS 2005 with .Net framework 2.0 and crystal report version 10.
    We have migrated this application to azure using VS 2013 with .Net framework 4.5 and crystal report version 13.2.
    We have included the Crystal report msi in the package for deploying it on azure.
    We have used the CrystalReportViewer on one of the page in our application to view the reports but we are not able to view it.
    Thanks

    Here is a KBA that discusses Azure and CR:
    1765620 - What version of Crystal Reports supports Windows Azure?
    Note that the simple string "crystal azure" in the search box at the top right corner found the above as the very 1st hit. E.g.; please search 1st...
    The KBA points to the SAP Idea Place where anyone can ask for an enhancement to CR. Note that the Idea has been viewed 264 times and only voted up 4 times (one of those votes is mine). E.g.; it does not appear to be a highly demanded enhancement and I do not believe it will ever see the light of day.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Some reports don't open in CrystalReportViewer

    We have a program that uses a CrystalReportViewer to open reports, and it's been working fine. Recently I made a report (with no parameters) in CR XI that will display correctly in the designer and show data, but when I try to open it in the program, it won't show up. The Viewer window appears, but it is just blank white. It has the status bar, but it just shows "Current Page No.:" and "Total Page No.:" with no information after them. I have even made a very simple report that uses no database access or parameters, and just has a simple text object in it, in addition to the date and page number. That one won't show up either.
    Does anyone have any idea of what might cause some reports to show up in CrystalReportViewer and others not?

    No responses yet... Here is a little more information.
    The program using these reports was made a few years ago, and the reports may have been made with an earlier version of Crystal Reports (10 or earlier). The existing reports open fine in the CrystalReportsViewer in this program. If I open one of these reports in a more recent Crystal Reports editor (version XI or even 2008), modify it, and save it, it will still display correctly.
    It is only when I create a new report in CR XI or 2008 that it gives me the blank report in this program, even if the report is as simple as possible.
    Any ideas now?

  • Problem with variables in formulas when using CrystalReportViewer

    Post Author: Aksu
    CA Forum: Formula
    Hi! I have a problem with variables in Crystal Reports formulas, when using CrystalDecisions.Windows.Forms.CrystalReportViewer class from VS2005-project. ReportViewer always gives error:*************Crystal Report Windows Forms ViewerThis field name is not known.Details: errorKindError in File C:\{dir&#93;}\{file}.rpt:Error in formula <mCustomerAttributes>.'Dim result As String'This field name is not known.Details: errorKind ************* Report without variables works fine with Viewer and in Crystal Reports Designer report with variables works also fine. I have tried with both "formula-syntaxes" - basic and crystal. But Viewer always gives error when trying to define new variable.I think the problem might be with CR -versions, because VS-project has formerly been designed to VS2003 and CR9 or 10. Now I'm using VS2005 and CR11. Though I have changed all references to new CrystalDecisions-asseblies (Ver.11.0.3300.0), when I debug the project and checkout the Viewers ReportSources FormatEngine Shows version CR9_2.... I have no idea where it gets this version...***************DEBUG-view when Viewer is created *******************CrystalReportViewer    |_        ReportSourceClassFactoryName ... , Version=11.0.3300.0 , ...    |_            ReportSource            |_                FormatEngine    {CrystalDecisions.CrystalReports.Engine.FormatEngine}                        |_                        ClientVersionHeader    {CrystalDecisions.Shared.ReportServiceVersionHeader}                            |_                            |    version = 920     (int)                            |_                                Static members                                            |_                                        VER_CR9    = 920    (int)**************************************** Could anyone have any answers or tips for this problem? I'd really appreciate it... ---Aksu

    Has anyone been able to answer this question?
    I am having the same problem:
    I am designing a report in Crystal Reports XI Developer that contains parameters, which are passed to a stored procedure and are also used within formulas ( in Crystal Syntax ie. {?FORMAT_ID} ) in the report itself.
    I can run the report successfully in CRXI Developer.  The formulas use the correct values from the parameters entered during execution and everything looks good.
    I then deploy the report to Business Objects Enterprise XI.  I do all of the things necessary to manage the report including setting up the proper database connection information and default parameter values.
    When I run the report using the Crystal Report Viewer, I get the following error message:
    Error in File Forecasting.rpt:
    Error in formula <Report Format>.
    'if (not isNull({?FORMAT_ID} ) ) then
    This field name is not known.
    Details: errorKind
    This happens when I press the "Preview" button in the Manage Object dialog from Crystal or when I run the report using InfoView.
    I have changed the formulas and it doesn't seem to matter what the specific content of the formula is; other than the existence of a parameter reference in the formula.  If I comment out the parameter and replace it with a hard-coded value, it gets through the formula fine.
    Does Business Objects Enterprise XI support crystal reports with parameter references in the formulas?
    Thanks,
    Tim H.
    Edited by: Tim Haley on Nov 25, 2008 11:11 PM
    Edited by: Tim Haley on Nov 25, 2008 11:12 PM

  • Performance issue in CrystalReportViewer.processHttpRequest(), Java SDK

    Hi,
    We are using BOXI R2 sp3. We have a schedular which schedule the reports on daily basis and create the file on boxi server. These reports are shown to the user on web UI through jsp. Below are the steps I am following while showing the report on UI:
    1) Create the IEnterpriseSession object for the user session and save it for future use.
    2) Get a reference to the IReportSourceFactory using EnterpriseSession.GetService(u201CPSReportFactoryu201D).
    3) Open the report source using IReportSourceFactory.openReportSource(<report id>, Locale) call.
    4) Create the CrystalReportViewer object and set the report source in it. Below I am showing all the settings for crystal report viewer object.
          CrystalReportViewer reportViewer = new CrystalReportViewer();
          reportViewer.setEnterpriseLogon(es);
          try {
         reportViewer.setReportSource(reportSource);
          } catch (ReportSDKExceptionBase e) {
         logger.log(Level.SEVERE, "", e);
          reportViewer.setDisplayPage(true);
          reportViewer.setDisplayGroupTree(false);
          reportViewer.setDisplayToolbar(true);
          reportViewer.setOwnPage(true);
          reportViewer.setHasViewList(true);
          reportViewer.setHasLogo(false);
          reportViewer.setHyperlinkTarget("_blank");
          reportViewer.setHasRefreshButton(false);
          reportViewer.setEnableDrillDown(true);
    5) Call processHttpRequest() function on crystal report viewer object to display the report on UI.
    These steps works fine in order to display the report on UI but the issue I am facing is related to time. This entire process is taking almost 1 minute to display 10,000 pages of reports which is not acceptable in our case. This time delay is happening for first time when user is viewing the report since later it is being served from cache but problem doesn't get resolved using cache. The cache size is limited and we have lot of these kind of reports so cache will get swapped often.
    I tried debugging the above code and found that processHttpRequest() call itself takes 55 seconds. Could anybody tell me what this function is doing internally and why it is taking so much time.
    My manager is thinking to get rid of crystal reports because of this issue and develop our own custom solution. Please provide any help if anybody knows about it.

    I found some more query in code after digging up further:
    After getting the folder id, We execute the below query to display list of all avaialble reports on the server
    Select SI_ID, SI_NAME, SI_LAST_RUN_TIME From CI_INFOOBJECTS Where SI_PROGID='CrystalEnterprise.Report' And        SI_INSTANCE=0 AND SI_PARENTID = "     + serverDao.getReportFolderID(iSession) + " ORDER BY SI_NAME
    The SIID returned for a report from above query is passed to get all the instances for it in another query, which is mentioned below:
    Select * From CI_INFOOBJECTS Where SI_PROGID='CrystalEnterprise.Report' AND SI_INSTANCE=1 AND SI_SCHEDULE_STATUS=1 AND SI_PARENTID = " + SI_Identifier + " ORDER BY SI_ENDTIME DESC
    This query returns me the list of instances with SIID. Finally this SIID is used to get the content. I hope this answer your query.
    Also I tried the crystal interactive viewer yesterday but found no difference in performace. Could you tell me how exactly we can use the interactive viewer.

  • BPS_WB-Can i add a query to a Web interface tabpage?

    Dear experts,
    In a BPS web interface application, i have already a tab page which allows users to input their data. Now i would like to add a second tabpage which allows to display the existing data.
    Is that possible to link a BEX query to a Tabpage BPS web interface application? I would like that the query is launched and the result is displayed each time an user click on this tabpage.
    Thanks in advance.

    Include your query in a web template and follow the approach given in the link http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a861d590-0201-0010-248a-fc70d8d29f26
    Edited by: Deepti Maru on Nov 30, 2010 10:24 AM

  • CrystalReportViewer Failed to Open the connection Unable to retrieve Object

    I am getting the following Error on trying to view a report in the CMC and the Infoview.
    CrystalReportViewer
    Failed to Open the connection. ReportName
    Unable to retrieve Object.
    Failed to open the connection. ReportName
    I have recently re-installed Crystal Reports Server XI  on a server after a disk failure. I had a backup of my CMS database. I reinstalled the Crystal Servwer without atttaching this database, however crystal did not create a new db so I attached my old one.
    I have deleted all my old ODBC connections and recreated them with new names and then reconnected my reports in Crystal Reports XI using the "Set Datasource Location" option and the report works fine.But as soon as I try to view it after uploading it as an object onto the server, I get the above error.
    Any help would be appreciated.

    I am tagging into this unanswered question as well because I think I have a similar issue.  In my case I have a report which runs correctly in Crystal Reports designer but when I move it to the scheduler it fails on a "Failed to connect" to the report.  In have used "Set data location" to no avail.  When I go to Admin Tools and look at the complete list of datasources for all my reports this particular datasource is listed twice.  The group of reports under one of the datasources works correctly.  The reports listed under the second datasource all fail.  The two datsources are spelled exactly the same and when I sompare the database details for a successfull and a failing report using this datasource they are the same (in the console and in infoview).
    I have also checked the ODBC connections on the Crystalserver and there is only one occureence.
    Any ideas?
    Thanks!

  • Help!!! (CrystalDecisions.Web.CrystalReportViewer) is not compatible with the type of control (CrystalDecisions.Web.CrystalReportViewer)

    Post Author: mrmc
    CA Forum: General
    Hi all,
    Recently, I got problem on using cystal report on asp.net web. the error msg is:
    Parser Error Message: The base class includes the field 'viewer', but its type (CrystalDecisions.Web.CrystalReportViewer) is not compatible with the type of control (CrystalDecisions.Web.CrystalReportViewer).
    in the code:
    <%@ Register TagPrefix="ce" Namespace="CrystalDecisions.Enterprise.WebControls" Assembly="CrystalDecisions.Enterprise.Web, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" %>
    <CR:CrystalReportViewer id="viewer" runat="server" AutoDataBind="true" HasCrystalLogo="False" Width="350px"          Height="50px" HasToggleGroupTreeButton="False" DisplayGroupTree="False" HasGotoPageButton="False" HasRefreshButton="True"          DisplayToolbar="False"></CR:CrystalReportViewer>
    In web.config
    <add assembly="CrystalDecisions.Web, Version=11.0.3300.0, Culture=neutral, PublicKeyToken=1234567890"/>
    the server contains crytal report 9 (come from .net studio) and crytal report 11 (installed standalone). 
    I googled this problem, it seems a lot of people got this problem but no solution...
    could anyone help me?  Thanks!

    Post Author: david.wilkes
    CA Forum: General
    You might try Removing the Reference and re-adding the reference. That seemed to get me pass this error, but I ran into another error that I have not figured out yet.

  • How can I modify the UI for the crystalreportviewer prompt screen ?

    <p>Hi,</p><p> I am using Crystal Report XI with JRC.</p><p>I have come across a couple of issues. My report accepts 2 parameters from the user. One is a date field and the other is the &#39;Period&#39;. I have provided a drop-down having values as Daily, Weekly, Monthly, Quarterly, Yearly.</p><p> The following are the issues that I have come across:</p><p>1. Selecting a value from the drop-down and submitting the form gives the following error.</p><p>     [java] 17:46:20,265 INFO  [STDOUT] 17:46:20,265 ERROR [com.businessobjects.reports.sdk.JRCCommunicationAdapter] JRCAgent11 detected an exception: The value for parameter `Period` must match one of the specified default values.<br />     [java]     at com.crystaldecisions.reports.dataengine.d.case(Unknown Source)<br />     [java]     at com.crystaldecisions.reports.dataengine.d.at(Unknown Source)<br />     [java]     at com.crystaldecisions.reports.dataengine.d.new(Unknown Source)<br />     [java]     at com.crystaldecisions.reports.common.as.a(Unknown Source)<br />     [java]     at com.crystaldecisions.reports.common.ae.a(Unknown Source)<br />     [java]     at com.businessobjects.reports.sdk.b.k.a(Unknown Source)<br />     [java]     at com.businessobjects.reports.sdk.b.s.do(Unknown Source)<br />     [java]     at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)<br />     [java]     at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)<br />     [java]     at com.crystaldecisions.proxy.remoteagent.x.a(Unknown Source)<br />     [java]     at com.crystaldecisions.proxy.remoteagent.q.a(Unknown Source)<br />     [java]     at com.crystaldecisions.proxy.remoteagent.q.else(Unknown Source)<br />     [java]     at com.crystaldecisions.proxy.remoteagent.q.for(Unknown Source)<br />     [java]     at com.crystaldecisions.proxy.remoteagent.q.do(Unknown Source)<br />     [java]     at com.crystaldecisions.proxy.remoteagent.q.if(Unknown Source)<br />     [java]     at com.crystaldecisions.proxy.remoteagent.u.performDo(Unknown Source)<br />     [java]     at com.crystaldecisions.proxy.remoteagent.u.a(Unknown Source)<br />     [java]     at com.crystaldecisions.sdk.occa.report.application.DataDefController.a(Unknown Sour<br />ce)<br />     [java]     at com.crystaldecisions.sdk.occa.report.application.ParameterFieldController.modify(<br />Unknown Source)<br />     [java]     at com.crystaldecisions.sdk.occa.report.application.ParameterFieldController.modify(<br />Unknown Source)<br />     [java]     at com.crystaldecisions.sdk.occa.report.application.ParameterFieldController.setCurr<br />entValues(Unknown Source)<br />     [java]     at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)<br />     [java]     at com.crystaldecisions.sdk.occa.report.application.ReportSource.a(Unknown Source)<br />     [java]     at com.crystaldecisions.sdk.occa.report.application.ReportSource.getPromptParameterF<br />ields(Unknown Source)<br />     [java]     at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.getPromptPa<br />rameterFields(Unknown Source)<br />     [java]     at com.crystaldecisions.sdk.occa.report.application.NonDCPAdvancedReportSource.getPr<br />omptParameterFields(Unknown Source)<br />     [java]     at com.crystaldecisions.reports.reportengineinterface.JPEReportSource.getPromptParam<br />eterFields(Unknown Source)</p><p> When in the report I set allowcustomvalues to true then it accepts the value selected from the dropdown. But in this case the prompt screen shows a textbox next to the drop-down that gets populated on selecting any option from the dropdown. This textbox is editable and can accept any value. Is there a way I can get rid of this textbox. Also i would like to know why the drop-dwon by itself is incapable of passing the value.</p><p> 2. Secondly, Is there anyway I can change the UI for the crystalreportviewer prompt screen being displayed for accepting the parameters from the user. As per my clients requirement the messages displayed in the prompt screen should be customised.</p><p>3. The third issue is with the date parameter. When a date is selected using the calender control the textbox gets populated in the following format Date(yyyy,mm,dd). My requirement is that this should be a userfriendly format like mm-dd-yyyy. I have succesfully modified the crystalreportviewer javascript so that the calender returns the date in the required format i.e. mm-dd-yyyy. But in this case the date parameter is not accepted though no error is displayed on the console. I have tried rechanging the format into Date(yyyy,mm,dd) before the prompt form is submitted but even this didnot help. What can I do to overcome this problem? </p><p>Any help with respect to the above problems will be highly appreciated.</p><p>Thanks & Regards</p>

    <p>From the looks of it, the default parameter prompt screen isn&#39;t really fitting your requirements.  You have a number of requests for modification.</p><p>In your case I think the best thing to do would be to create your own parameter prompt screen.  You can use the SDK to create a page that works for all reports by inspecting the reports parameters before you set the values.</p><p>This would allow you the flexibility of easily meeting your customers requirements.</p><p>Point 1 - I&#39;m not sure.</p><p>Point 2 - There isn&#39;t much access to change the prompt screen.</p><p>Point 3 - I&#39;m not sure why you would want to change the formatting of the Date when you are already using a calendar object to get it.  It sounds like you might have a small mistake in the way you edited the javascript.</p><p>I really think you are probably better off creating your own prompt screen. <br /></p><p>Rob Horne<br /><a href="/blog/10">Rob&#39;s blog - http://diamond.businessobjects.com/blog/10</a></p>

  • How to display a report in CrystalReportViewer when report is a Shortcut

    Hello,
    In BusinessObjects Enterprise XI R2, we have a shortcut to a report since we don't want to give a particular group of users access to the original folder. However, my objective is to display the "shortcut" report in a .NET web application.
    What I'm running into seems to basically be permissions errors when setting the ReportSource of the CrystalReportViewer to the ID of the shortcut. In InfoView, the same user can click the shortcut and the report comes up with no problems.
    So my question is how do I display this report in my application's viewer and still honor the privs of the shortcut, and of not the original report?
    Partial code listing...
    ' load the report
    Dim reportId As String = Me.SessionState.ReportId
    myReportViewer.ReportSource = MyInfoStoreManager.GetReportSource(myEnterpriseSession, reportId)
    myReportViewer.EnterpriseLogon = myEnterpriseSession
    The relevant code in the GetReportSource method is below...
    ' retrieve the report from BOXI Infostore
    Dim objReportFactoryService As EnterpriseService = myEnterpriseSession.GetService("PSReportFactory")
    Dim objFactory As Viewing.PSReportFactory = CType(objReportFactoryService.Interface, Viewing.PSReportFactory)
    Dim objReportSource As ISCRReportSource
    objReportSource = objFactory.OpenReportSource(intReportId)
    Return objReportSource
    Thanks,
    Horus

    Since you're using XI Release 2, there'd be limited options.  XI 3.x allow for greater control of rights inheritance, so you can specify no-view rights for the folder, but view rights for the contents of the folder.
    So with XI Release 2, since you can't control inheritance, you'd restrict rights to the parent folder, but give each report within specific rights tailored to the User or UserGroup.  If you have lots of reports, the rights admin overhead may be problematic, since you'd need to manage them per-object.
    Sincerely,
    Ted Ueda

  • CrystalReportViewer: "Missing parameter values with implemented error event

    I'm using the CrystalReportViewer in APS.net (C#), and try to display a report in it.
    I've implemented the error event of the viewer to show the user a different error message than the viewer itself does.
             this.CrystalReportViewer.Error += new CrystalDecisions.Web.ErrorEventHandler(CrystalReportViewer_Error);
          protected void CrystalReportViewer_Error(object source, CrystalDecisions.Web.ErrorEventArgs e)
             var msg = "Error in CrystalReportViewer\r\n{0}".FormatInvariant(e.ErrorMessage);
             throw new InvalidOperationException(msg);
    But.... Now if I want to show a report that has parameters in it, the parameter page does not appear before the report itself. How can I make my code work (without removing the implementation of the error event), so the viewer first shows the parameter page, before showing the actual report?

    And in the Page_Load method:
    this.CrystalReportViewer.Error += new CrystalDecisions.Web.ErrorEventHandler(CrystalReportViewer_Error);
    I've done this so i can show my own error page to the user of the website. Otherwise the CRViewer shows his own error, and I do not want the user of the website to see this 'technical' error.
    So i've implemented the CrystalReportViewer.Error method:
    protected void CrystalReportViewer_Error(object source, CrystalDecisions.Web.ErrorEventArgs e)
       // Missing parameter values.
       var discardToShowParameterPrompt = (e.ErrorMessage.ToUpperInvariant() == "Missing parameter values.".ToUpperInvariant())
         || (e.ErrorMessage.ToUpperInvariant() == "Ontbrekende parameterwaarden.".ToUpperInvariant());
       if (discardToShowParameterPrompt)
          _Log.Debug("The parameter screen should be displayed now.");
       else
          var msg = "Error in CrystalReportViewer: {0}".FormatInvariant(e.ErrorMessage);
          throw new InvalidOperationException(msg);
    If I load a report with no params in the report, the page shows immediately the report.
    If I load a report with params in the report, the params page is shown, the user can enter the param values, and after pressing OK, the report is shown.
    If an error occurs (for example the report cannot connect to the database), the viewer does NOT show the error (because i've implemented the _error event) but my code throws an InvalidOperationException, and this is handled by code so the error is logged to a file, and the user gets a user friendly message on the website.
    If i do not implement the _error event, the user will see the technical error in the crystal reports viewer.
    If I comment out the code where I'm looking for the string "Missing parameter values." (or "Ontbrekende parameterwaarden") the parameter page will not be shown, and an error will be thrown by the Crystal Reports viewer.
    If I put e.handled = true in the _error event, and there is an error (for example the database cannot be found), no error will be thrown, and there is nothing to see in the viewer.
    So for now the only way to get the params page is to implement the _error event the way i've done in the above code, checking the error message on a string value.

Maybe you are looking for

  • PDF in Frame - Open Web Link does not open in new window

    I actually have 2 problems. 1. Acrobat 7.0.9. Added a link to open a web page. When the pdf is viewed from within a frame on a web page, the web page link in the pdf does not open in a new window but replaces the pdf in the frame. 2. If I download th

  • Where can i buy a genuine iPad 4 replacement screen?

    help please!

  • ANN: XDK 9.0.2Beta Available

    New Beta releases of the Oracle XDKs (9.0.2.0.0A) are now available online athttp://otn.oracle.com/tech/xml. In these releases, in addition to the bug fixes, are the following new features and enhancements: - New XMLType bean and XMLDiff bean are int

  • Deleting old address in Mac OS X Mail

    When I update a persons e-mail address, it shows properly in address book, but when I access it from within mail by typing in the name, i'm shown the old e-mail as well as the new one. How do I remove the old? David

  • TS1424 Unable to download podcast, error?

    I keep getting an "unable to download podcast error"...  It has hung in the downloads for iStore for months.  When I tap to retry, same error.. It is only 1 podcast.  I don't know how to remove it from my downloads...