Last active
          December 20, 2015 01:49 
        
      - 
      
- 
        Save hidayat365/6052000 to your computer and use it in GitHub Desktop. 
    Menampilkan Report Crystal Report
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public void ShowProfitLossReport(int month, int year) | |
| { | |
| InitializeConnectionInfo(); | |
| rpt = new Finance.rptProfitLoss(); | |
| rpt.ParameterFields["bulan"].CurrentValues.AddValue(month); | |
| rpt.ParameterFields["tahun"].CurrentValues.AddValue(year); | |
| rpt.ParameterFields["span"].CurrentValues.AddValue("MONTHLY"); | |
| SetReportLogonInfo(rpt); | |
| crViewer1.ReportSource = rpt; | |
| crViewer1.Zoom(1); | |
| } | |
| private void InitializeConnectionInfo() | |
| { | |
| cnInfo = new ConnectionInfo(); | |
| cnInfo.ServerName = Config.Server; | |
| cnInfo.DatabaseName = "accounting"; | |
| cnInfo.UserID = "sa"; | |
| cnInfo.Password = "*****"; | |
| } | |
| private void SetReportLogonInfo(ReportDocument reportDocument) | |
| { | |
| Tables tables = reportDocument.Database.Tables; | |
| foreach (Table table in tables) | |
| { | |
| TableLogOnInfo tableLogonInfo = table.LogOnInfo; | |
| tableLogonInfo.ConnectionInfo = cnInfo; | |
| table.ApplyLogOnInfo(tableLogonInfo); | |
| } | |
| } | |
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment