Showing posts with label value. Show all posts
Showing posts with label value. Show all posts

Sunday, March 25, 2012

Access chart Palette color set in custom code

Hi, all. I am doing a pie chart, to display the market value for each asset type. I couldn't put the market value and asset type together in the legend, so I create another table behind the pie chart. Since I want to use the table to replace the legend of pie chart, I plan to put a retangle with same color of each asset type in the pie chart. How can I use the Palette color serizes like Excel, Earth Tone, Pastel in the assemble custom code?

I recommend to just define your own color palette and use it in both the chart and the custom table legend. Check this blog article for an example and explanations: http://blogs.msdn.com/bwelcker/archive/2005/05/20/420349.aspx

-- Robert

|||Thanks, Robert. It helps

Access chart Palette color set in custom code

Hi, all. I am doing a pie chart, to display the market value for each asset type. I couldn't put the market value and asset type together in the legend, so I create another table behind the pie chart. Since I want to use the table to replace the legend of pie chart, I plan to put a retangle with same color of each asset type in the pie chart. How can I use the Palette color serizes like Excel, Earth Tone, Pastel in the assemble custom code?

I recommend to just define your own color palette and use it in both the chart and the custom table legend. Check this blog article for an example and explanations: http://blogs.msdn.com/bwelcker/archive/2005/05/20/420349.aspx

-- Robert

|||Thanks, Robert. It helps

Thursday, March 22, 2012

Access a textbox from another textbox

Is it possible to get the value of a textbox from another textbox ? I can't
seem to find a way. What I am trying to do is sum a field that is only
listed on the report. Based on several factors there are multiple rows not
displayed and what I want to do is sum all of the rows that are displayed.
If I have a textbox called txtPrice, is there a way to access that (like
=txtPrice.text) in a different textbox and then additionally do a
=Sum(txtPrice.text).
Anyone?
Thanks!
ChrisTry
ReportItems!<textboxName>.Value
Jackson
"Chris Hastings" <chrshstngs@.comcast.net> wrote in message
news:2eOdne6G48T-ivTeRVn-jQ@.comcast.com...
> Is it possible to get the value of a textbox from another textbox ? I
> can't seem to find a way. What I am trying to do is sum a field that is
> only listed on the report. Based on several factors there are multiple
> rows not displayed and what I want to do is sum all of the rows that are
> displayed. If I have a textbox called txtPrice, is there a way to access
> that (like =txtPrice.text) in a different textbox and then additionally do
> a =Sum(txtPrice.text).
> Anyone?
> Thanks!
> Chris
>|||Hi Jackson,
Thanks! That answered my question, but unfortunately didn't solve my
problem.
I'm trying to get a sum of only fields that actually appear on the report
vs. fields that are in the entire dataset. Any ideas on that one?
Thanks!
Chris
"Jackson" <jackson_num5@.yahoo.com> wrote in message
news:uLHVad$3FHA.1420@.TK2MSFTNGP09.phx.gbl...
> Try
> ReportItems!<textboxName>.Value
> Jackson
> "Chris Hastings" <chrshstngs@.comcast.net> wrote in message
> news:2eOdne6G48T-ivTeRVn-jQ@.comcast.com...
>> Is it possible to get the value of a textbox from another textbox ? I
>> can't seem to find a way. What I am trying to do is sum a field that is
>> only listed on the report. Based on several factors there are multiple
>> rows not displayed and what I want to do is sum all of the rows that are
>> displayed. If I have a textbox called txtPrice, is there a way to access
>> that (like =txtPrice.text) in a different textbox and then additionally
>> do a =Sum(txtPrice.text).
>> Anyone?
>> Thanks!
>> Chris
>>
>|||I think you can do that by adding a footer and in one of the footer fields
right click and go into expressions.
There you'll be able to sum up the fields that appear in the reports detail
area. So you can type this
=Sum(Fields!Field1.Value)+Sum(Fields!Field2.Value) etc.
Hope that helps,
Jackson
"Chris Hastings" <chrshstngs@.comcast.net> wrote in message
news:v5WdncrjzMToofTeRVn-pg@.comcast.com...
> Hi Jackson,
> Thanks! That answered my question, but unfortunately didn't solve my
> problem.
> I'm trying to get a sum of only fields that actually appear on the report
> vs. fields that are in the entire dataset. Any ideas on that one?
> Thanks!
> Chris
> "Jackson" <jackson_num5@.yahoo.com> wrote in message
> news:uLHVad$3FHA.1420@.TK2MSFTNGP09.phx.gbl...
>> Try
>> ReportItems!<textboxName>.Value
>> Jackson
>> "Chris Hastings" <chrshstngs@.comcast.net> wrote in message
>> news:2eOdne6G48T-ivTeRVn-jQ@.comcast.com...
>> Is it possible to get the value of a textbox from another textbox ? I
>> can't seem to find a way. What I am trying to do is sum a field that is
>> only listed on the report. Based on several factors there are multiple
>> rows not displayed and what I want to do is sum all of the rows that are
>> displayed. If I have a textbox called txtPrice, is there a way to access
>> that (like =txtPrice.text) in a different textbox and then additionally
>> do a =Sum(txtPrice.text).
>> Anyone?
>> Thanks!
>> Chris
>>
>>
>|||Hi again Jackson,
Thanks for taking the time.
A little background.
I have a query that joins multiple tables (I can't do subselects because my
ODBC driver doesn't support them), so for a given item that I want, I need
information from 4 other tables, for which I have to use joins. I group by
the main item and then use the First(field!..) to display the information
and I hide my detail line. By the way, one of the pieces of information I
want from another table is just a count, but in any case, there could be 1
record for an item or 1000, depending on the sub tables. It's annoying...
Anyway, the main item table has a price in it, and I want to sum all of the
prices for the items for a customer. The problem is that each item is
actual between 1 to 1000 actual records because of the other joins. So, my
Sums are completely goofy. The mental block I am trying to overcome is that
I can see exactly what I want to sum on the screen (because it's in a group
header and there are no detail lines) but I can't for the life of me figure
out a way to either sum the information that appears only on the report, or
sum pieces of the recordset based on other aggregate functions (like first
or count).
I'm contemplating forcing them to move their data to SQL, but I'm thinking
that is unlikely...
"Jackson" <jackson_num5@.yahoo.com> wrote in message
news:u%23Vke9$3FHA.2816@.tk2msftngp13.phx.gbl...
> I think you can do that by adding a footer and in one of the footer fields
> right click and go into expressions.
> There you'll be able to sum up the fields that appear in the reports
> detail area. So you can type this
> =Sum(Fields!Field1.Value)+Sum(Fields!Field2.Value) etc.
>
> Hope that helps,
> Jackson
>
> "Chris Hastings" <chrshstngs@.comcast.net> wrote in message
> news:v5WdncrjzMToofTeRVn-pg@.comcast.com...
>> Hi Jackson,
>> Thanks! That answered my question, but unfortunately didn't solve my
>> problem.
>> I'm trying to get a sum of only fields that actually appear on the report
>> vs. fields that are in the entire dataset. Any ideas on that one?
>> Thanks!
>> Chris
>> "Jackson" <jackson_num5@.yahoo.com> wrote in message
>> news:uLHVad$3FHA.1420@.TK2MSFTNGP09.phx.gbl...
>> Try
>> ReportItems!<textboxName>.Value
>> Jackson
>> "Chris Hastings" <chrshstngs@.comcast.net> wrote in message
>> news:2eOdne6G48T-ivTeRVn-jQ@.comcast.com...
>> Is it possible to get the value of a textbox from another textbox ? I
>> can't seem to find a way. What I am trying to do is sum a field that
>> is only listed on the report. Based on several factors there are
>> multiple rows not displayed and what I want to do is sum all of the
>> rows that are displayed. If I have a textbox called txtPrice, is there
>> a way to access that (like =txtPrice.text) in a different textbox and
>> then additionally do a =Sum(txtPrice.text).
>> Anyone?
>> Thanks!
>> Chris
>>
>>
>>
>

Sunday, March 11, 2012

accept user from user to enter a field value for a sql

Hi-

I am trying to achieve a similar query in ORACLE but donno how to do it in Ms SQL Server and MS Access (I have to do it for both these databases)

SELECT * FROM someTable
WHERE someField = &EnterValue

When this query is executed in ORACLE, it will ask user to enter value for &EnterValue and then execute the query using the user entered value.

Can this be done in MS SQL Server and MS ACCESS?

Please help...

ThanksHi-

Found the answer for MsAccess, I need to enter =[EnterValue] in Criteria for a given column.

Still looking for answer for MS SQL Server. Is Stored Proc the only answer?

Please help...

Best Wishes,|||SQL Server will not prompt the user for a parameter value. It needs to be supplied.

It is normally done like this:


SELECT * FROM someTable
WHERE someField = @.someValue

and Parameters are used to provide the query with the parameter value that the user has input from a data entry screen. You do not necessarily need a stored procedure to accomplish this (although I believe that is the best way).

Check out the ASP.NET tutorialServer-Side Data Access, especially the "Performing a Parameterized Select" section, to see how to use Parameters with ADO.NET.

Terri

Tuesday, March 6, 2012

About the value of each week

I have an rpt in crosstab that view the total sales of each salesman in every week. This is the rpt looks like:

Week 35 Week 36 Week 37 Week 38
Eric 100 200.25 300 500
Vlad 320 400 0 400

My problem is, if a salesman sales in a week is equal to zero, the sales that must be viewed will be the sale last week.

Here's the rpt must look like this..

Week 35 Week 36 Week 37 Week 38
Eric 100 200.25 300 500
Vlad 320 400 340 400use a formula for displaying value

something like

if sales>0 then
sales
else
previous(sales)|||Thanx! i will try

About the value of each week

I have an rpt that view the total sales of every week in crosstab design
Week 35 Week 36 Week 37 Week 38Do you have any specific question?

Thursday, February 16, 2012

About ODBC + VC++

Hi,

I can't get ntext field value from my database (or nvarchar).

If I write in my database in english, I get only the 2 first letters.

If I write in my database in hebrew, I get gibbrish letters.

please I need some help

I'm using sql serser 2000, CRecordset, CDatabase, ODBC

Code Snippet

CDBVariant val;

rs.GetFieldValue("activity",val);

CString activity = (*activityVal.m_pstring).GetBuffer(0);

I'm sorry but I've not used MFC very much, but I've used ODBC, and this looks to me like you're fetching Unicode characters into ANSI buffers. The first thing I would try is defining your application as a Unicode app by adding the following add the beginning of your code:

#define UNICODE

#define _UNICODE

Here's a link to using ODBC via MFC: http://msdn2.microsoft.com/en-us/library/s9ds2ktb(VS.80).aspx

Hopefully someone else on this alias is more familiar with MFC to help you out.

Good luck!

~Warren

|||

Thank's,

Do you know how can I define these in my project? how to use this?

#define UNICODE

#define _UNICODE

about multiplication in sql

what is the value when running sql script?

select cast(cast(.0000006 as numeric(38,10)) * cast(1.0 as numeric(38,10)) as numeric(38,10))

the result is .0000010000.

why the result is not .0000006000?

It looks to be rounding it upto the nearest decimal place, as the result has one fewer zeros to the right of the decimal point. WHy it would do this I am not sure.|||

The reason the scale of the result has been reduced to 6 is interesting. You have asked SQL Server to multiply two numerics, each with 38 precision and 10 scale.

Conceptually, the result should be a numeric(77, 20). However, this is above SQL Server's maximum precision, so the result would need to be truncated.

An implementation decision was made to sacrifice some scale to gain more digits on the left side of the decimal point, up to a minimum of scale 6. So the numeric(77,20) is actually converted to numeric(38, 6). The same behavior happens for division.

That decision is based off the assumption that digits on the left side of the decimal point are usually more important than the ones on the right side. It can pay off in a different situation:

select cast(1234567890123456789012345678.0 as numeric(38,10)) * cast(10.0 as numeric(38,10))

Here, the extra scale was not actually important, so sacrificing it to get more digits on the left side of the decimal point paid off.

To keep SQL Server from guessing if the scale is needed or not, you need to type your numerics appropriately if possible. In your example:

select cast(cast(.0000006 as numeric(10,10)) * cast(1.0 as numeric(2,1)) as numeric(38,10))

Yields the appropriate results. The result of the multiplication is conceptually numeric(13,11) which is well within our limits.

I hope this helps, and let me know if this work around does not work for you.

-Mat

|||In addition to Matt's comments, please take a look at the "Precision, Scale, and Length" topic in Books Online. The url is mk:@.MSITStore:C:\Program%20Files\Microsoft%20SQL%20Server\80\Tools\Books\tsqlref.chm::/ts_da-db_8rc5.htm. This topic explains the formula used to arrive at the resulting precision of arithmetic operations involving two numeric values.|||thanks for your help~|||

Thank you for your reply.

I can find 'tsqlref.chm' but not know how to go '/ts_da-db_8rc5.htm' .Can you tell me how to do.Thanks.


I know how to find.^_^

use the tool bar,GO-->URL.... to open 'Jump to URL'

|||If you have SQL Server 2000 Books Online installed then go to Go\Url menu option and paste the url. You can also search for this topic in MSDN.

Thursday, February 9, 2012

About alias of data field

Anyone knows is it possible to use an expression in alias or get the value for alias from another table?

No. Field aliases are constants.|||if you want to conditionally refer to a field, you could use the Items() collection syntax. For example, let's say you wanted to display one of two fields based on a parameter:

Fields.Items(Parameters!SelectedField.Value).Value