Skip to content

Commit

Permalink
Merge pull request #51 from mhertzfeld/1.11.0.0
Browse files Browse the repository at this point in the history
Changed to use External XML file for Default Values
  • Loading branch information
mhertzfeld authored May 20, 2021
2 parents db5d8b5 + d18917a commit 6752dc2
Show file tree
Hide file tree
Showing 13 changed files with 721 additions and 52 deletions.
69 changes: 69 additions & 0 deletions Source/CrystalReportsNinja/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="CrystalReportsNinja.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<userSettings>
<CrystalReportsNinja.Properties.Settings>
<setting name="SQL_Use_IntegratedSecurity" serializeAs="String">
<value>False</value>
</setting>
<setting name="EnableLogToConsole" serializeAs="String">
<value>True</value>
</setting>
<setting name="SMTP_Server_Address" serializeAs="String">
<value>Smtp.office365.com</value>
</setting>
<setting name="SMTP_Server_Port" serializeAs="String">
<value>587</value>
</setting>
<setting name="SMTP_SSL_Reqruired" serializeAs="String">
<value>True</value>
</setting>
<setting name="SMTP_Authentication_Used" serializeAs="String">
<value>True</value>
</setting>
<setting name="Email_CC" serializeAs="String">
<value>NA</value>
</setting>
<setting name="Email_BCC" serializeAs="String">
<value>NA</value>
</setting>
<setting name="Email_Message_Body" serializeAs="String">
<value>The information contained is intended for the named recipients only, it may contain confidential and/or legally privileged information and is only intended for the use of the person to whom it is addressed. If you have received this e-mail in error you must not copy, duplicate, forward, print or distribute any information contained herein, but must ensure that this e-mail is permanently deleted and advise the sender. </value>
</setting>
<setting name="Keep_Outputfile_after_Sending" serializeAs="String">
<value>True</value>
</setting>
<setting name="Default_Printer_Name" serializeAs="String">
<value />
</setting>
<setting name="SQL_Server_Name" serializeAs="String">
<value>SQLSERVERNAME</value>
</setting>
<setting name="SQL_Database_Name" serializeAs="String">
<value>SQLDBNAME</value>
</setting>
<setting name="SQL_User_Name" serializeAs="String">
<value>REPORTUSERNAME</value>
</setting>
<setting name="SQL_Password" serializeAs="String">
<value>REPORTUSERPASSWORD</value>
</setting>
<setting name="SMTP_User_Name" serializeAs="String">
<value>USERNAME</value>
</setting>
<setting name="SMTP_Password" serializeAs="String">
<value>PASSWORD</value>
</setting>
<setting name="Email_From" serializeAs="String">
<value>noreply@noreply.com</value>
</setting>
<setting name="Email_From_Display_Name" serializeAs="String">
<value>NoReply</value>
</setting>
<setting name="Email_Subject" serializeAs="String">
<value>Automated Crystal Reports</value>
</setting>
</CrystalReportsNinja.Properties.Settings>
</userSettings>
</configuration>
55 changes: 38 additions & 17 deletions Source/CrystalReportsNinja/ArgumentContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ namespace CrystalReportsNinja
{
public class ArgumentContainer
{
/// <summary>
/// -I Use Integrated Security for Database Credentials
/// </summary>
public Boolean IntegratedSecurity { get; set; }

/// <summary>
/// -U Report database login username (mandatory unless integrated security login)
/// </summary>
Expand Down Expand Up @@ -171,32 +176,46 @@ public ArgumentContainer()
{
// Assigning default values
GetHelp = false;
EnableLog = false;

//Report Config
ReportPath = null;
OutputPath = null;
OutputFormat = null;
PrintOutput = false;
PrintCopy = 1;
PrinterName = "";
PrinterName = Properties.Settings.Default.Default_Printer_Name;
Refresh = true;
///SelectionFormula = null;
///Culture = null;

//SQL Server Config
ServerName = Properties.Settings.Default.SQL_Server_Name;
DatabaseName = Properties.Settings.Default.SQL_Database_Name;
IntegratedSecurity = Properties.Settings.Default.SQL_Use_IntegratedSecurity;
UserName = Properties.Settings.Default.SQL_User_Name;
Password = Properties.Settings.Default.SQL_Password;

//Email Config
MailTo = null;
MailBcc = "NA";
MailCC = "NA";
EmailOutput = false;
MailFrom = "noreply@noreply.com";
MailFromName = "Crystal Reports";
SmtpServer = null;
SmtpPort = 25;
SmtpSSL = false;
SmtpAuth = false;
SmtpUN = null;
SmtpPW = null;
EmailSubject = "Crystal Reports";
EmailBody = "NA";
EmailKeepFile = false;
MailCC = Properties.Settings.Default.Email_CC;
MailBcc = Properties.Settings.Default.Email_BCC;
MailFrom = Properties.Settings.Default.Email_From;
MailFromName = Properties.Settings.Default.Email_From_Display_Name;
SmtpServer = Properties.Settings.Default.SMTP_Server_Address;
SmtpPort = Convert.ToInt32(Properties.Settings.Default.SMTP_Server_Port);
SmtpSSL = Properties.Settings.Default.SMTP_SSL_Reqruired;
SmtpAuth = Properties.Settings.Default.SMTP_Authentication_Used;
SmtpUN = Properties.Settings.Default.SMTP_User_Name;
SmtpPW = Properties.Settings.Default.SMTP_Password;
EmailSubject = Properties.Settings.Default.Email_Subject;
EmailBody = Properties.Settings.Default.Email_Message_Body;
EmailKeepFile = Properties.Settings.Default.Keep_Outputfile_after_Sending;

//Logging Options
EnableLogToConsole = false;
EnableLog = false;
LogFileName = String.Empty;
EnableLogToConsole = Properties.Settings.Default.EnableLogToConsole;

// Collection of string to store parameters
ParameterCollection = new List<string>();
Expand All @@ -219,6 +238,8 @@ public void ReadArguments(string[] parameters)
UserName = parameters[i + 1];
else if (parameters[i].ToUpper() == "-P")
Password = parameters[i + 1];
else if (parameters[i].Equals("-I"))
IntegratedSecurity = true;
else if (parameters[i].ToUpper() == "-F")
ReportPath = parameters[i + 1];
else if (parameters[i].ToUpper() == "-O")
Expand Down Expand Up @@ -279,7 +300,7 @@ public void ReadArguments(string[] parameters)
}
}

if (parameters[i] == "-?" || parameters[i] == "/?")
if (parameters[i] == "-?" || parameters[i] == "/?" || parameters[i] == "?")
GetHelp = true;

if (parameters[i].ToUpper() == "-L")
Expand Down
18 changes: 18 additions & 0 deletions Source/CrystalReportsNinja/CrystalReportsNinja.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Export.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="CrystalDecisions.CrystalReports.Engine, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL" />
<Reference Include="CrystalDecisions.Shared, Version=13.0.4000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL" />
Expand All @@ -81,6 +87,11 @@
</ItemGroup>
<ItemGroup>
<Compile Include="ArgumentContainer.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="Helper.cs" />
<Compile Include="LogWriter.cs" />
<Compile Include="ParameterCore.cs" />
Expand All @@ -90,6 +101,13 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="Export.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Binary file added Source/CrystalReportsNinja/Export.ico
Binary file not shown.
1 change: 1 addition & 0 deletions Source/CrystalReportsNinja/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public static void ShowHelpMessage()
Console.WriteLine("Copyright(c) 2017 Rainforest Software Solution http://www.rainforestnet.com");
Console.WriteLine("CrystalReportsNinja Arguments Listing");
Console.WriteLine("\n -------------- DB and Report Config --------------");
Console.WriteLine(" -I Use Intergrated Security for DB Access. (Optional, False by Default");
Console.WriteLine(" -U database login username. (Optional, If not set IntegratedSecurity is used");
Console.WriteLine(" -P database login password. (Optional, If not set IntegratedSecurity is used");
Console.WriteLine(" -F Crystal reports path and filename. (Mandatory)");
Expand Down
2 changes: 0 additions & 2 deletions Source/CrystalReportsNinja/ParameterCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public class ParameterCore
public ParameterCore(string logfilename, ArgumentContainer _ArgumentContainer)
{
_userParams = new List<UserParameter>();

_parameterCollection = _ArgumentContainer.ParameterCollection;
_logger = new LogWriter(logfilename, _ArgumentContainer.EnableLogToConsole);
}
Expand Down Expand Up @@ -75,7 +74,6 @@ public ParameterValues GetParameterValues(ParameterFieldDefinition ParameterDef)

}
}

return paramValues;
}

Expand Down
4 changes: 2 additions & 2 deletions Source/CrystalReportsNinja/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.8.0.0")]
[assembly: AssemblyFileVersion("1.8.0.0")]
[assembly: AssemblyVersion("1.9.0.1")]
[assembly: AssemblyFileVersion("1.9.0.1")]
63 changes: 63 additions & 0 deletions Source/CrystalReportsNinja/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6752dc2

Please sign in to comment.