CrystalReportViewer WPF

How can I bind the CrystalReportViewer (WPF) with a MemoryStream or a ByteArray ?
In our applicantion we create the report using the ExportToStream but how can we show the
report without saving the stream in a file ?
It seems strange that we can generate the report in a stream but we can't bind it to the viewer
on a client application. We use the WPF Viewer.
Thank you
Marco

Hello Marco
You can not stream a report to a viewer. Your options;
1) Stream to PDF
2) Install CR runtime on the client, export the report on the server to a share, then view the report on the client.
3) Use a web app
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]

Similar Messages

  • CrystalReportViewer in WPF - win32 exception on application closing

    Hello!
    I'am using the CrystalReportViewer Control in a WindowsFormsHost control as the rest of the application is made in WPF.
    If the application is closed when a Report is open, the "Visual Studio JIT" Debugger windows is opened informing me that an unhandled win32 exception occured in my application although VS 2008 Writes in the output window "The program <MyApplication> has exited with code 0 (0x0)"
    This error occured only when a report document has been opened. Trying to find the error, I found out that Report.Dispose() must be called to avoid the JIT message. As WPF does not support IDisposable I had to find another way to call reportClass.Dispose() when the application is closed.
    I created a private ReportClass Object to which I assign the different reports that I have created. In the constructor I add the event Dispatcher.ShutdownStarted and created the handler for the event.
    private ReportClass reportClass
    public void MyConstructor()
         Dispatcher.ShutdownStarted += Dispatcher_ShutdownStarted;
    private void Dispatcher_ShutdownStarted(object sender, EventArgs e)
        If ( reportClass != null)
           reportClass.Dispose();

    The oracle drivers are notoriously wobbly.  Or used to be.  I thought they had been improved though.
    If you can possibly, update with later dll.
    Binary chop might be your best bet to work out exactly what the issue is.
    Unfortunately this is going to be hard work.
    I would write a test harness to stick on a virtual server and emulate bits of your functionality.
    I would probably start with just insert/update/delete to oracle in various ways.
    Se if you can make it go bang with a programme you can easily experiment with.
    I would also get a free subscription to ants profiler and make sure you have no memory leaks.
    They can cause weird behaviour.
    This is less likely though since you'd usually notice some different errors.
    By the way.
    You probably aren't attacking your datalayer.  That means hitting it or the like.   Something like connecting might be a better word to choose there.
    Not that this is at all important.  Your customers are presumably French.
    Hope that helps.
    Recent Technet articles:
    Property List Editing ;  
    Dynamic XAML

  • How to display the print dialogbox in crystal reports viewer for visualstudio 2013 in wpf?

    Hi,
    In my wpf application when i click on print button i want to display the print dialog box for current report.
    Here i have written like as follows.
    1.MyCrystalReportsViewer.ViewerCore.ReportSource = reportDocument;
    2. MyCrystalReportsViewer.ViewerCore.PrintReport();
    The above two statements  is executed and displayed the report in CrystalReportViewer, but it doesn't show any print dialogbox.
    MyCrystalReportsViewer is name of the CrystalReportsVIewer control.
    Can any one help me to solve this one using code.

    Hi Sandeep,
    Did you download CR for VS SP 13 from this link?
    http://scn.sap.com/docs/DOC-7824
    First link is to integrate CR into VS.
    If you did then I suggest you do a Repair on both VS and CR for VS.
    Also, VS must be Pro or higher, CR will not work in VS 2013 Express.
    Do you have printers installed? Do not use Windows XPS printer, it has problems.
    Don

  • WPF Crystal report throws an exception when user tries to replace a file which is open during export of report.

    I am using the latest version of crystal report CRforVS_13_0_10 with Visual Studio 2013.
    I am working a WPF application and using the WPF crystalreportviewer control.
    The steps to reproduce the exception is ,
    1) Create a report.
    2) Export report with sample.xls  as file name
    3) Now open the sample.xls file in Excel
    4) Again export the report with sample.xls  as file name
    5) There is dialog which asks "Do you want to replace existing file sample.xls"
    6)Click "Yes"
    7) Now the exception will be thrown.
    This is System.IO.IOException which is thrown by crystal report  when user tries to save the file which is already opened by user. Also there is no event provided to handle Export_click for WPF CrystalReportViewer where I can handle this.

    I can replicate the issue. Not sure how we can hook into the System.IO process to capture the exception. I have not played with that part yet...
    I created my own export button and wrapped it in a try/catch and this is what I get:
    Which is what you would expect rather than a Null Exception error:
    We'll have to do more testing to see how or if System IO errors can caught outside of CR.
    Don

  • 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

  • A proper solution to a WPF application using On Screen Keyboard

    Hi.
    I´ve been working for some time on a good OSK solution for my WPF apps, that are running on a tablet. But it´s hard working with the OSK.exe and tabtip.exe, because of several bugs, strange behaviour and no standardized solution to this ordinary problem.
    What I (probably) need is a custom textbox control, which inherits from System.Windows.Controls.TextBox, and overrides some methods.
    The simple requirements for this textbox should be:
    1. When a user clicks in a textfield, the tabtip.exe (or alike) keyboard should pop up at the bottom of the screen (default).
    2. If the keyboard pops up on top of the textbox, the contentframe should scroll so that the textbox is visible.
    3. When the textbox loses focus, the keyboard should close automatically, except if the user clicks on another textbox.
    This seems like pretty standard behaviour right? Well I´ve looked a long time for solutions (there is no standard microsoft way which is kind of weird), and as said I´ve tried making my own but with no luck. For example, sometimes when I try to kill the process,
    it fails. When I click the close button in the upperright corner on the keyboard, like 5-6-7 times, it closes. The behaviour from PC to tablet is not consistent. The ScrollViewer.ScrollToVerticalOffset(x); sometimes doesent work on a tablet, and so on.
    So does any of you know a good solution to this common problem?

    Hello Farsen.
    I have been creating a Win8 app for my business and in learning that I discovered they have "LayoutAware" pages.  The basic idea behind the LayoutAware page is that they move the page up when the keyboard is active and that different layouts
    can be set for the tablet orientation.
    You could apply the same basic concept to WPF using VisualStateManager.
    Here is a real quick example....
    <Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
    x:Class="WpfApplication27.MainWindow"
    x:Name="Window"
    Title="MainWindow"
    Width="640" Height="480">
    <Grid x:Name="LayoutRoot">
    <VisualStateManager.VisualStateGroups>
    <VisualStateGroup x:Name="VisualStateGroup">
    <VisualStateGroup.Transitions>
    <VisualTransition GeneratedDuration="0:0:0.2"/>
    </VisualStateGroup.Transitions>
    <VisualState x:Name="KeyboardOpen">
    <Storyboard>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="grid">
    <EasingDoubleKeyFrame KeyTime="0" Value="-130"/>
    </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    </VisualState>
    <VisualState x:Name="KeyboardClosed"/>
    </VisualStateGroup>
    </VisualStateManager.VisualStateGroups>
    <VisualStateManager.CustomVisualStateManager>
    <ei:ExtendedVisualStateManager/>
    </VisualStateManager.CustomVisualStateManager>
    <Grid x:Name="grid" HorizontalAlignment="Center" Height="41.92" VerticalAlignment="Center" Width="200" RenderTransformOrigin="0.5,0.5">
    <Grid.RenderTransform>
    <TransformGroup>
    <ScaleTransform/>
    <SkewTransform/>
    <RotateTransform/>
    <TranslateTransform/>
    </TransformGroup>
    </Grid.RenderTransform>
    <TextBox TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" GotFocus="TextBox_GotFocus" LostFocus="TextBox_LostFocus"/>
    <Button Content="Button" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="75"/>
    </Grid>
    </Grid>
    </Window>
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Shapes;
    namespace WpfApplication27
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    public MainWindow()
    this.InitializeComponent();
    // Insert code required on object creation below this point.
    private void TextBox_GotFocus(object sender, System.Windows.RoutedEventArgs e)
    Process.Start("TabTip.exe");
    VisualStateManager.GoToElementState(LayoutRoot, "KeyboardOpen", true);
    private void TextBox_LostFocus(object sender, System.Windows.RoutedEventArgs e)
    Process[] processlist = Process.GetProcesses();
    foreach(Process process in processlist)
    if (process.ProcessName == "TabTip")
    process.Kill();
    VisualStateManager.GoToElementState(LayoutRoot, "KeyboardClosed", true);
    break;
    Now, I'm sure folks get right tired of my shouting Blend. But... if you have Blend you could make short work of setting this up.
    If you open your project in Blend, select the xaml page with the design view showing. 
    Select the "States" tab.
    Click the "Add State" button and you can double click the state that appears to rename it or rename it directly in xaml.
    Change the Transition Duration if desired.
    Select the state and you will see that "State Recording" is active.
    Just move your items where you want them for that state.
    I hope that gives you some ideas.
    ~Christine
    Edit. The red ellipse in the image above circles the "Add State" button.

  • 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?

  • Visual Studio opening files when dragged and dropped in WPF app debugging session

    I'm working on a WPF app (using VS2013 CE) which is intended to manage media files (TV Shows, movies, etc) and as part of this I am enabling the user to drag and drop media files on to the running app (by adding AllowDrop="True" and PreviewDragEnter="Window_PreviewDragEnter"
    to my Window definition).
    The problem I have is that when I drag files onto the app in a debugging session Visual Studio then opens the file(s) when I stop debugging... this is seriously annoying as when I am testing with large media files (> 1GB) it just locks up VS for minutes
    at a time while it tries to open the file or files. When I run the app outside the debugger this does not happen - it's only when I'm in a VS debugging session.  The only way I can stop this happening is to kill VS completely from Task Manager then restart
    it - this is also very annoying but often I need to do this as it will freeze up for 5-10 minutes while it insists on loading the files in VS.
    I understand the app, whilst debugging, is running in the context of VS but why does VS then have to try to open the files when debugging is finished?   I have looked through the options but can't see anything to switch this off and no amount of searching
    has turned up anything - can anyone put me out of my misery with a solution to this annoying issue?

    Hello nzmike,
    Does Visual Studio behaves like the following image shows and just hangs when opening your media file?
    Do you have any other computer which installs Visual Studio? Can you reproduce this on it?
    In order to troubleshoot this issue I think we need to locate the root reason of your issue. The problem can related to the following:
    1. Your project is corrupt and VS then trys to load that file when debug finished.
    2. Your VS is corrupt and caused this problem.
    So please do something below:
    1. Try clean and rebuild your project.
    2. Switch to some other PCs and use VS and your project there, check if the problem can be reproduced.
    3. You can backup your VS setting and try some commands: devenv /resetsettings and devenv /resetuserdata
    Details about VS command:https://msdn.microsoft.com/en-us/library/xee0c8y7.aspx
    And based on th research of the above second step, if you can reproduce this issue on more than one PC, the problem is pending on your project and I need you to share a simple sample which can reproduce this issue. We will need to investigate the project
    in detail.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • 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

  • Does QTP/UFT support "Microsoft.Windows.Control" (one type of wpf control)?

    Hello,
    I have a challenge automating WPF Application in which they used new type of Wpf Data GridControl i.e "Microsoft.Windows.Control". We cannot access all the properties of this control(RowCount,GetCelldata). Can Anyone get this issue and provide me details of any patch that can resolve this issue?
    Please let me know if you need more info and provide resolution ASAP

    Hello,
    I have a challenge automating WPF Application in which they used new type of Wpf Data GridControl i.e "Microsoft.Windows.Control". We cannot access all the properties of this control(RowCount,GetCelldata). Can Anyone get this issue and provide me details of any patch that can resolve this issue?
    Please let me know if you need more info and provide resolution ASAP

  • 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.

  • Performance problem with WPF Viewer CRVS2010

    Hi,
    We are using Crystal Reports 2010 and the new WPF Viewer. Last week when we set up a test machine to run our integration tests (several hundred) all report tests failed (about 30 tests) with a timeout exception.
    The testmachine setup:
    HP DL 580 G5
    WMWare ESXi 4.0
    Guest OS: Windows 7 Enterprise 64-bit
    Memory (guest OS): 3GB
    CPU: 1
    Visual Studio 2010
    Crystal Reports for Visual Studio 2010 with 64 bit runtime installed
    Visual Studio 2008 installed
    Microsoft Office 2010 installed
    Macafee antivirus
    There are about 10 other virtual machines on the same HW.
    I think the performance problem is related to text obejcts on a report document viewed in a WPF Viewer. I made a simple WPF GUI with 2 buttons and the first button executes a very simple report that only has a text object with a few words in it and the other button is also a simple report with only 1 text object with approx. 100 words (about 800 charchters).
    The first report executes and displays almost instantly and the second report executes instantantly but displays after approx. 1 min 30 sec.
    And execute in this context means that all VB.Net code runs in the compiler without any exception or performance problem. The performance problem seems to come after viewer.Show() (in the code below) has executed.
    I did another test on the second report and replaced the text obejct with a formula field with the same text as the text object and this test executed and displayed the report instantly.
    So the performance problem seems to have something to do with rendering of textobjects in the WPF Viewer on a virtual machine with the above setup.
    I've made several tests on local machines with Windows XP (32 bit) or Winows 7 (64 bit) installed and none of them have this performance problem. Its not a critical issue for us because our users will run this application on their local PCs with Windows 7 64-bit but its a bit problematic for our project not being able to run all of our integration tests but I will probably solve this by using a local PC instead.
    Here is the VB.Net code Im using to View the reports:
    Private Sub LightWeight_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
            Dim lightWeightReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
            lightWeightReport.Load(Environment.CurrentDirectory & "\LightWeight.rpt")
            ' Initialize Viewer
            Dim viewer As LF.LIV.PEAAT.Crystal.Views.ReportViewer = New LF.LIV.PEAAT.Crystal.Views.ReportViewer()
            viewer.Owner = Me
            viewer.reportViewer.ViewerCore.ReportSource = lightWeightReport
            viewer.Show()
        End Sub
        Private Sub LightWeightSlow_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
            Dim lightWeightReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
            lightWeightReport.Load(Environment.CurrentDirectory & "\LightWeightSlow.rpt")
            ' Initialize Viewer
            Dim viewer As LF.LIV.PEAAT.Crystal.Views.ReportViewer = New LF.LIV.PEAAT.Crystal.Views.ReportViewer()
            viewer.Owner = Me
            viewer.reportViewer.ViewerCore.ReportSource = lightWeightReport
            viewer.Show()
        End Sub
    The reports are 2 empty default reports with only 1 textobject on the details section.
    // Thomas

    See if the KB [
    [1448013  - Connecting to Oracle database. Error; Failed to load database information|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333433343338333033313333%7D.do] helps.
    Also the following may not hurt to have a look at (if only for ideas):
    [1217021 - Err Msg: "Unable to connect invalid log on parameters" using Oracle in VS .NET|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313337333033323331%7D.do]
    [1471508 - Logon error when connecting to Oracle database in a VS .NET application|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333433373331333533303338%7D.do]
    [1196712 - Error: "Failed to load the oci.dll" in ASP.NET application against an Oracle database|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333133393336333733313332%7D.do]
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • Animated GIF in WPf

    Hello, how do i add an animated GIF into a frame in a WPF application
    and only show it when i press a button

    You need to add refrence of WindowsFormsIntegration and System.Windows.Forms DLLs to your project. The following code will load gif file:
    <wfi:WindowsFormsHost
    xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
    xmlns:winForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms">
    <winForms:PictureBox x:Name="pictureBox" ImageLocation="C:\Images\progressbar.gif">
    </winForms:PictureBox>
    </wfi:WindowsFormsHost>
    If you need button click, then on button click handler you need to load the image to PictureBox.
    <StackPanel>
    <Button Name="btnLoad" Click="btnLoad_Click">Load</Button>
    <wfi:WindowsFormsHost>
    <winForms:PictureBox x:Name="pictureBox">
    </winForms:PictureBox>
    </wfi:WindowsFormsHost>
    </StackPanel>
    private void btnLoad_Click(object sender, RoutedEventArgs e)
    pictureBox.ImageLocation = @"C:\Images\progressbar.gif";
    Manoj Mandal

  • 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

  • DataTrigger is not working in xaml wpf

    Hi All,
    I want to change the Data templates dynamically based on some selection. Here I have used DataTrigger to which I have binded a property which is not working. I don't know why its not working.
    Please find below .xaml code -                                
            <DataTemplate x:Key="StackTemplate">
                <TextBlock x:Name="txtStack" Text="We are using Stack Panel"></TextBlock>
            </DataTemplate>
            <DataTemplate x:Key="DockTemplate">
                <TextBlock x:Name="txtDock" Text="We are using Dock Panel"></TextBlock>
            </DataTemplate>
            <DataTemplate x:Key="WrapTemplate">
                <TextBlock x:Name="txtWrap" Text="We are using Wrap Panel"></TextBlock>
            </DataTemplate>
            <DataTemplate x:Key="CanvasTemplate">
                <TextBlock x:Name="txtcanvas" Text="we are using Canvas panel"></TextBlock>
            </DataTemplate>
        </Window.Resources>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="50"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="170"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Grid.Row="0" x:Name="Txtblk" Text="Choose Layout Panel"></TextBlock>
            <ComboBox Grid.Column="1" Width="200"  ItemsSource="{Binding Source={StaticResource LoadCombo}}" Margin="66,12,66,0"></ComboBox> // loaded from xaml
            <ItemsControl Grid.Column="1" Grid.Row="1" x:Name="itemctrl" Height="250" Width="280">
                <DataTemplate>
                    <ContentControl Content="{Binding}">
                        <ContentControl.Style>
                            <Style TargetType="{x:Type ContentControl}">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding Path=MyProperty,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="0">
                                        <Setter Property="ContentTemplate" Value="{StaticResource StackTemplate}"></Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding Path=MyProperty,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="1">
                                        <Setter Property="ContentTemplate" Value="{StaticResource DockTemplate}"></Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding Path=MyProperty,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="2">
                                        <Setter Property="ContentTemplate" Value="{StaticResource WrapTemplate}"></Setter>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding Path=MyProperty,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="3">
                                        <Setter Property="ContentTemplate" Value="{StaticResource CanvasTemplate}"></Setter>
                                    </DataTrigger>                                
                                </Style.Triggers>
                            </Style>
                        </ContentControl.Style>
                    </ContentControl>
                </DataTemplate>
            </ItemsControl>
    Here is my .xaml.cs class - 
      public partial class MainWindow : Window
            public string Select { get; set; }
            public string MyProperty
                get
                    string number=string.Empty;
                    switch (Select)
                        case "STACKPANEL": 
                            number = "0"; break;
                        case "DOCKPANEL":
                            number = "1"; break;
                        case "WRAPPANEL":
                            number = "2"; break;
                        case "CANVAS":
                            number= "3"; break;
                    return number;
            public MainWindow()
                InitializeComponent();
                DataContext = this;
                Select = "0";
                cmb.SelectionChanged += new SelectionChangedEventHandler(cmb_SelectionChanged);
            void cmb_SelectionChanged(object sender, SelectionChangedEventArgs e)
                Select = (sender as ComboBox).Text;
    Please help me.

    That isn't going to work.
    Selecting datatemplate is a one off process.
    When you're looking at the view, it's done.
    I think if you used a contenttemplateselector you could force the issue:
    MyControl.ContentTemplateSelector =
    new MyDataTemplateSelector();
    I very rarely use those myself though.
    Personally, I would be inclined to just switch out the control for a new one with the appropriate template.
    It's a view responsibility so doing that in code behind isn't even breaking mvvm.
    Your code coverage might dip a little, but this doesn't look like a real app anyhow.
    I agree with Andy, using DataTemplateSelector should be the right direction, please refer to this case to know how it works:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/f7c60968-f3a0-499a-a20e-01aac82d942f/datatemplate-for-generic-type-is-not-working?forum=wpf
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • ISE Custom AUP for Guest Wireless

    Hi All, I am trying to setup Guest wireless using Cisco ISE for the first time.  Under Multi-Portal Configurations, i was hoping to be able to edit the DefaultGuestPortal profile so that I could change the wording of the AUP from Cisco's Blurb.  Can

  • INSTALLATION LIGHTROOM IMPOSSIBLE

    Lorsque j'essaye d'installer Lightroom 4 que je viens d'acheter sur CD, j'ai le message suivant : an error...... of assembly component {6435B7C0-EOC8-3EA2-91AE-7640034EAFCE}.HRESULT/0x8007054F. Quelqu'un pourrait-il me dire ce qui se passe ? Merci

  • What does a file name like NYC14_(1008_of_88).cr2 mean?

    NYC14 is my renaming convention.  Naturally, it's followed by (1009 of 88) etc.

  • Oracle Streams 10gR2 Schedule Propagation or Application

    Hi all, Is there a way to schedule the propagation and application when configuring Oracle Streams?, I mean, I don't want to execute online replication because I have other object outside Oracle that need to replicate withing the db to have my aplica

  • Itunes help can not access the internet even when the PC is connected

    When opening itunes help the error message is returned that says itunes help is unavailable because my PC has no internet connections, which is ironic since I am typing this!  any help?