How to use Select Case in crystal Reports? - crystal-reports-2010

Hi Developers i'm novice in Crystal Reports and i have a wrote the following code.
Select ({Historico.Moeda})
case "MT":
if (IntPart = 1) then
DescDecimal := "Metical"
else
DescDecimal := "Meticais";
if (decimalPart = 0,01) then
DescInt : = "Centavo"
else
DescInt : = "Centavos";
default:
"Metical";
When i trie to view the report i'm getting the following error: The ) is missing and I don't know why can anyone please help me.
I appreciate your help!

Related

I can't run a correlation with ggcorrmat

I am getting this error when running a correlation matrix with the R package ggstatsplo
ggcorrmat(data = d, type = "nonparametric", p.adjust.method = "hochberg",pch = "")
Error: 'data_to_numeric' is not an exported object from 'namespace:datawizard'
Somebody could help me.
I expected to have the script to run normally as I have used it before (around July) without any errors.
Is there anything that has changed about the ggstatsplot package?

Why recent project and solution pinned always is false?

I'm writing a extension package for VS 2019, So far i find out how to get "Recent projects and solutions" items, These items have a PropertyInfo called "Pinned" which means that project or solution is pinned, Except it's always false.
Here is the code which i get project list and show it to user :
IVsDataSourceFactory objFactory = serviceProvider.GetService(typeof(SVsDataSourceFactory)) as IVsDataSourceFactory;
objFactory.GetDataSource(new Guid("9099ad98-3136-4aca-a9ac-7eeeaee51dca"), 1, out IVsUIDataSource dataSource);
Type typProjectMruList = Type.GetType("Microsoft.VisualStudio.PlatformUI.ProjectMruList, Microsoft.VisualStudio.Shell.UI.Internal", true);
System.Reflection.PropertyInfo itemsProperty = typProjectMruList.GetProperty("Items");
Type typFileSystemMruItem = Type.GetType("Microsoft.VisualStudio.PlatformUI.FileSystemMruItem, Microsoft.VisualStudio.Shell.UI.Internal", true);
System.Reflection.PropertyInfo pathProperty = typFileSystemMruItem.GetProperty("Path");
System.Reflection.PropertyInfo pinnedProperty = typFileSystemMruItem.GetProperty("Pinned");
IList lstItems = (IList)itemsProperty.GetValue(dataSource, null);
string strMsg = "";
for (var i = lstItems.Count - 1; i > -1; i--)
{
string strPath = (string)pathProperty.GetValue(lstItems[i], null);
bool blnPinned = (bool)pinnedProperty.GetValue(lstItems[i], null);
strMsg = strMsg + "Path : " + strPath + Environment.NewLine + "Pinned : " + blnPinned.ToString() + Environment.NewLine + Environment.NewLine;
}
// Show a message box to prove we were here
VsShellUtilities.ShowMessageBox(
package,
strMsg,
"",
OLEMSGICON.OLEMSGICON_INFO,
OLEMSGBUTTON.OLEMSGBUTTON_OK,
OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);
Anyone tried to do something like this before? Or this is a bug and i should report it to microsoft?
If you want to test this code just create a new command and put this code in "Execute" void.
Anyone tried to do something like this before? Or this is a bug and i
should report it to microsoft?
Based on your description, when I try your code and when I debug this project, create a new project in solution explorer, I faced the same issue as you said: the value of blnPinned is always false though the project is pinned.
So l have reported this issue on our DC Forum for you. See this link which I hope anyone who is interested in this issue will vote for you.
You can vote on this issue and add any comment if I forgot some detailed info to attract more attention. With this further step, I hope the staff will give a satisfactory feedback.

Testrail API Ruby add_result_for_case error

I am executing the code below as a cucumber step. The test case id is
C70. I tried a run ID and it gave the same error.
The code and error are below -
-----------------
require 'testrail-ruby'
client = TestRail::APIClient.new('https://xxxx.testrail.net')
client.user = 'xxxxxxxxxx.com'
client.password = 'xxxxxx'
r = client.send_post(
'add_result_for_case/C270',
{ :status_id => 1, :comment => 'This test worked fine!' }
)
puts r
The Error:
TestRail API returned HTTP 400 ("Field :run_id is not a valid ID.")
What am I doing wrong? I have researched this topic and have not resolved it Please advise....
I found my problem . I should have used the full Test Case ID. The ID that found when running the actual test case . The issue is resloved.
Extra suggestion.
Do not use characters other than numbers when giving the ID information. For example, when giving the case Id, it shows up as C270 in Testrail. But you have to give it as 270 in Api. In another example, let your RunId be R150. You only need to give it as 150.

" transmitting spi data..ioc" invalid argument

Hi guys I am new to coding and I am trying to monitor the voltage and resistance value of a potantiometer by using spi communication on raspberryPi3. I found that code but when I try to run it, the program gives me:
Problem transmitting spi data..ioc" invalid argument
I read the code carefully again but I couldn't find anything wrong. Maybe I am missing something. If you help me it would be so good. Thanks:) By the way the code is here:
http://www.hertaville.com/interfacing-an-spi-adc-mcp3008-chip-to-the-raspberry-pi-using-c.html
You should try to fully initialize your SPI structure.
.........
spi[i].speed_hz = this->speed ;
spi[i].bits_per_word = this->bitsPerWord ;
spi[i].cs_change = 0;
//Ypu should add this lines
spi[i].pad = 0;
spi[i].tx_nbits = 0;
spi[i].rx_nbits = 0;
It should help :)

Reporting in Microsoft AdCenter (Sandbox) - RoR

I am using AdCenter API for my RoR application. I searched a lot on Internet to find example of ruby code to fetch account performance report using API, But didn't get.. Now I have written following code but submitGenerateReport returns nil
Here is my code.
report_request = AccountPerformanceReportRequest.new
start_date = 10.days.ago.strftime("%Y-%m-%d")
end_date = Time.zone.now.strftime("%Y-%m-%d")
scope = AccountReportScope.new
scope.accountIds = [AppConfig.adcenter['accountId']]
# Specify the format of the report.
report_request.format = 'Xml'
report_request.returnOnlyCompleteData = false
report_request.language = 'English'
report_request.reportName = "My Account Report"
report_request.aggregation = 'Daily'
report_request.time = ReportTime.new(start_date, end_date)
report_request.columns = %w[ AccountName AccountName GregorianDate CurrentMaxCpc Impressions Clicks ]
report_request.scope = scope
report_request.filter = nil
report = SubmitGenerateReportRequest.new(report_request)
# Returns nil
puts response = svc.submitGenerateReport(report)
I have campaigns, adgroups as well as ads in specified account.
Can anyone please guide me where I am wrong or give some example of reporting adcenter through api using ruby?
Thanks in advance
Got the solution...
The time was not in right format so, start time and end time was unrecognisable in soap request. SOAP debugging helped me a lot..

Resources