Click here to Skip to main content
15,890,043 members
Home / Discussions / C#
   

C#

 
AnswerRe: Word was unable to read this document. It may be corrupt.Try one or more of the following:* Pin
F-ES Sitecore23-Jun-15 5:07
professionalF-ES Sitecore23-Jun-15 5:07 
GeneralRe: Word was unable to read this document. It may be corrupt.Try one or more of the following:* Pin
Vimalsoft(Pty) Ltd24-Jun-15 22:31
professionalVimalsoft(Pty) Ltd24-Jun-15 22:31 
GeneralRe: Word was unable to read this document. It may be corrupt.Try one or more of the following:* Pin
F-ES Sitecore24-Jun-15 23:13
professionalF-ES Sitecore24-Jun-15 23:13 
GeneralRe: Word was unable to read this document. It may be corrupt.Try one or more of the following:* Pin
Vimalsoft(Pty) Ltd24-Jun-15 23:22
professionalVimalsoft(Pty) Ltd24-Jun-15 23:22 
QuestionHow to convert to generic type method Pin
jameslooi8822-Jun-15 21:08
jameslooi8822-Jun-15 21:08 
AnswerRe: How to convert to generic type method Pin
OriginalGriff22-Jun-15 21:21
mveOriginalGriff22-Jun-15 21:21 
SuggestionRe: How to convert to generic type method Pin
Richard MacCutchan22-Jun-15 21:24
mveRichard MacCutchan22-Jun-15 21:24 
QuestionC# 2010 Access 2010 Report Automation Pin
SIMNecsa22-Jun-15 20:49
SIMNecsa22-Jun-15 20:49 
I want to populate a label in an Access report header, from C# using automation. The report has the following in the Load event:
VB
Option Compare Database
Private Sub Report_Load()
    Me.lblHeaderReport.Caption = Me.OpenArgs
End Sub
The C# source code:
C#
using MsAccess = Microsoft.Office.Interop.Access;

MsAccess.Application app = new MsAccess.Application();
       
            // open the access database file in shared mode
            app.OpenCurrentDatabase(
                    "C:\\Dev\\Databases\\SomeDatabase.mdb",
                    false,                 // Open shared
                     "some password"       // Password
                );

            string strFilter = "qSomeQueryForReport";  
            app.Visible = false;

            // open the report
             app.DoCmd.OpenReport(
                "rptSomeReport",  //ReportName
                Microsoft.Office.Interop.Access.AcView.acViewNormal,
                //Type.Missing,  // FilterName - Name of a saved filter query. 
                strFilter,
                Type.Missing,  // Where condition = valid SQL where condition.
                MsAccess.AcWindowMode.acWindowNormal,
                "HeaderTest"   // Open Args.
                );

     
            // cleanup
            // Close the report window: 
            app.DoCmd.Close(
               MsAccess.AcObjectType.acReport, //ObjectType
               "rptSomeReport", //ObjectName
               MsAccess.AcCloseSave.acSaveNo //Save
               );
            app.CloseCurrentDatabase();
            System.Runtime.InteropServices.Marshal.ReleaseComObject(app);  
 app = null;
Problem:
The text "HeaderTest" does not appear in the report header label. No error generated.

modified 23-Jun-15 4:08am.

QuestionHelp c# Pin
Member 1177333822-Jun-15 20:14
Member 1177333822-Jun-15 20:14 
AnswerRe: Help c# Pin
OriginalGriff22-Jun-15 20:20
mveOriginalGriff22-Jun-15 20:20 
QuestionJavascript with Visual Studio 2013 Pin
Dolly Nimavat22-Jun-15 17:54
Dolly Nimavat22-Jun-15 17:54 
AnswerRe: Javascript with Visual Studio 2013 Pin
Pete O'Hanlon22-Jun-15 18:59
mvePete O'Hanlon22-Jun-15 18:59 
AnswerRe: Javascript with Visual Studio 2013 Pin
F-ES Sitecore22-Jun-15 23:51
professionalF-ES Sitecore22-Jun-15 23:51 
GeneralDeveloping a Article Spinner… Pin
N8tiv22-Jun-15 17:13
N8tiv22-Jun-15 17:13 
QuestionConvert a function to C# Pin
Member 416962822-Jun-15 5:46
Member 416962822-Jun-15 5:46 
AnswerRe: Convert a function to C# Pin
PIEBALDconsult22-Jun-15 5:51
mvePIEBALDconsult22-Jun-15 5:51 
AnswerRe: Convert a function to C# Pin
Richard Deeming22-Jun-15 5:52
mveRichard Deeming22-Jun-15 5:52 
Questionhow do i change my startupform in vb Pin
Member 1178293322-Jun-15 4:46
Member 1178293322-Jun-15 4:46 
GeneralRe: how do i change my startupform in vb Pin
Sascha Lefèvre22-Jun-15 4:48
professionalSascha Lefèvre22-Jun-15 4:48 
AnswerRe: how do i change my startupform in vb Pin
Dave Kreskowiak22-Jun-15 5:11
mveDave Kreskowiak22-Jun-15 5:11 
GeneralRe: how do i change my startupform in vb Pin
Eddy Vluggen22-Jun-15 5:24
professionalEddy Vluggen22-Jun-15 5:24 
GeneralRe: how do i change my startupform in vb Pin
Dave Kreskowiak22-Jun-15 11:25
mveDave Kreskowiak22-Jun-15 11:25 
JokeRe: how do i change my startupform in vb Pin
Eddy Vluggen22-Jun-15 11:43
professionalEddy Vluggen22-Jun-15 11:43 
QuestionVS 2015 RC Pin
RugbyLeague22-Jun-15 1:58
RugbyLeague22-Jun-15 1:58 
AnswerRe: VS 2015 RC Pin
OriginalGriff22-Jun-15 2:27
mveOriginalGriff22-Jun-15 2:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.